public function locate($source)
    {
        $sources = [];
        $normalizedSources = [];
        
        // if the wildcard is at the end of the string, it means that we look for a directory
        $endingWithWilCard = substr($source, strlen($source) - 2) === '/*';
        
        if ($endingWithWilCard) {
            $source = substr($source, 0, strlen($source) - 2);
        }
        
        if (is_dir($source) || $endingWithWilCard) {
            $finder = new Finder();
            $finder
                ->files()
                ->in($this->removeLastSlash($source))
            ;
            
            foreach ($finder as $file) {
                $sources[] = $file;
            }
        } else if (strstr($source, '*') !== false) {
            // if the source contains a wildcard, we use it with the finder component
            $sources = $this->getSourcesFromFinder($source);
        } else {
            $sources[] = $source;
        }
        
        // each found sources should be normalized
        foreach ($sources as $source) {
            $normalizedSources[] = $this
                ->normalizer
                ->normalize($source);
        }
        
        return $normalizedSources;
    }
public function locate($source)
    {
        $sources = [];
        $normalizedSources = [];
        
        // if the wildcard is at the end of the string, it means that we look for a directory
        $endingWithWilCard = substr($source, strlen($source) - 2) === '/*';
        
        if ($endingWithWilCard) {
            $source = substr($source, 0, strlen($source) - 2);
        }
        
        if (is_dir($source) || $endingWithWilCard) {
            $finder = new Finder();
            $finder
                ->files()
                ->in($this->removeLastSlash($source))
            ;
            
            foreach ($finder as $file) {
                $sources[] = $file;
            }
        } else if (strstr($source, '*') !== false) {
            // if the source contains a wildcard, we use it with the finder component
            $sources = $this->getSourcesFromFinder($source);
        } else {
            $sources[] = $source;
        }
        
        // each found sources should be normalized
        foreach ($sources as $source) {
            $normalizedSources[] = $this
                ->normalizer
                ->normalize($source);
        }
        
        return $normalizedSources;
    }
public function locate ( $ source ) { $ sources = [ ] ; $ normalizedSources = [ ] ; // if the wildcard is at the end of the string, it means that we look for a directory $ endingWithWilCard = substr ( $ source , strlen ( $ source ) - 2 ) === '/*' ; if ( $ endingWithWilCard ) { $ source = substr ( $ source , 0 , strlen ( $ source ) - 2 ) ; } if ( is_dir ( $ source ) || $ endingWithWilCard ) { $ finder = new Finder ( ) ; $ finder -> files ( ) -> in ( $ this -> removeLastSlash ( $ source ) ) ; foreach ( $ finder as $ file ) { $ sources [ ] = $ file ; } } else if ( strstr ( $ source , '*' ) !== false ) { // if the source contains a wildcard, we use it with the finder component $ sources = $ this -> getSourcesFromFinder ( $ source ) ; } else { $ sources [ ] = $ source ; } // each found sources should be normalized foreach ( $ sources as $ source ) { $ normalizedSources [ ] = $ this -> normalizer -> normalize ( $ source ) ; } return $ normalizedSources ; }
Locate a source either if it a file or a directory and normalize it. Return an array of SplFileInfo.

@param mixed $source
@return SplFileInfo[]
@throws Exception
Locate a source either if it a file or a directory and normalize it . Return an array of SplFileInfo .