protected function getFiles() { if ($this->files === null) { $this->prepareFilters(); $this->files = array(); $fs = $this->pathname->rootAdapter()->getFilesystem(); $fileNames = $this->pathname->localAdapter()->ls($this->pathname); foreach ($fileNames as $fileName) { $childPathname = $this->pathname->child($fileName); $file = $fs->getFile($childPathname); if ($this->applyBitmaskFilters($file) && $this->applyGlobFilters($file) && $this->applyCallableFilters($file)) { $this->files[] = $file; } } $this->keys = array_keys($this->files); } return $this->files; }
/** * Get an iterator for this directory. * * @param int|string|\Closure|callable $filter Variable list of filters. * - Flags File::LIST_* * - Glob pattern * - Callables * * @return \Iterator * * @api */ public function getIterator($filter = null, $_ = null) { return $this->pathname->rootAdapter()->getIterator($this->pathname, func_get_args()); }
/** * @return \Filicious\File */ public function getFile() { return $this->pathname->rootAdapter()->getFilesystem()->getFile($this->pathname); }