protected function getSourcesFromFinder($source)
    {
        $array = explode(DIRECTORY_SEPARATOR, $source);
        $filename = array_pop($array);
        $directory = $source;
        $pattern = '*';
        
        // if a dot is present, the last part is the filename pattern
        if (strstr($filename, '.') !== false) {
            $pattern = $filename;
            $directory = implode('/', $array);
        }
        $finder = new Finder();
        $finder
            ->name($pattern)
            ->in($directory);
        
        $sources = [];
        
        foreach ($finder as $source) {
            $sources[] = $source;
        }
        
        return $sources;
    }
protected function getSourcesFromFinder($source)
    {
        $array = explode(DIRECTORY_SEPARATOR, $source);
        $filename = array_pop($array);
        $directory = $source;
        $pattern = '*';
        
        // if a dot is present, the last part is the filename pattern
        if (strstr($filename, '.') !== false) {
            $pattern = $filename;
            $directory = implode('/', $array);
        }
        $finder = new Finder();
        $finder
            ->name($pattern)
            ->in($directory);
        
        $sources = [];
        
        foreach ($finder as $source) {
            $sources[] = $source;
        }
        
        return $sources;
    }
protected function getSourcesFromFinder ( $ source ) { $ array = explode ( DIRECTORY_SEPARATOR , $ source ) ; $ filename = array_pop ( $ array ) ; $ directory = $ source ; $ pattern = '*' ; // if a dot is present, the last part is the filename pattern if ( strstr ( $ filename , '.' ) !== false ) { $ pattern = $ filename ; $ directory = implode ( '/' , $ array ) ; } $ finder = new Finder ( ) ; $ finder -> name ( $ pattern ) -> in ( $ directory ) ; $ sources = [ ] ; foreach ( $ finder as $ source ) { $ sources [ ] = $ source ; } return $ sources ; }
Return files sources using the finder to allow wild wards.

@param $source

@return SplFileInfo[]
Return files sources using the finder to allow wild wards .