Folder::children PHP Method

children() public method

Return a collection of subfolders
public children ( array $ignore = null, boolean $plain = false ) : mixed
$ignore array
$plain boolean
return mixed If $plain is true an array will be returned. Otherwise a Collection
    public function children($ignore = null, $plain = false)
    {
        $raw = $this->scan($ignore);
        if ($plain) {
            $content = array();
            foreach ($raw as $file) {
                if (is_dir($this->root . DS . $file)) {
                    $content[] = $file;
                }
            }
        } else {
            $content = new Collection();
            foreach ($raw as $file) {
                if (is_dir($this->root . DS . $file)) {
                    $content->append($file, new static($this->root . DS . $file));
                }
            }
        }
        return $content;
    }