src/CoreBundle/EventListener/DcGeneral/Table/RenderSettings/AddAssetListener.php
private function scanFiles($extension)
    {
        $files = [];
        foreach (Finder::create()->in($this->uploadPath)->name('*.' . $extension)->getIterator() as $item) {
            $files[] = 'files/' . Path::normalize($item->getRelativePathname());
        }

        return $files;
    }
private function scanFiles($extension)
    {
        $files = [];
        foreach (Finder::create()->in($this->uploadPath)->name('*.' . $extension)->getIterator() as $item) {
            $files[] = 'files/' . Path::normalize($item->getRelativePathname());
        }

        return $files;
    }
private function scanFiles ( $ extension ) { $ files = [ ] ; foreach ( Finder :: create ( ) -> in ( $ this -> uploadPath ) -> name ( '*.' . $ extension ) -> getIterator ( ) as $ item ) { $ files [ ] = 'files/' . Path :: normalize ( $ item -> getRelativePathname ( ) ) ; } return $ files ; }
Scan for files with the given extension.

@param string $extension The file extension.

@return array
Scan for files with the given extension .