private function doLocateFiles(string $path, string $environment): array
    {
        $fullPaths = array_filter(array_map(static function (string $fixturePath) use ($environment, $path): string {
            return '' !== $environment
                ? sprintf('%s/%s/%s', $path, $fixturePath, $environment)
                : sprintf('%s/%s', $path, $fixturePath);
        }, $this->fixturePaths), function ($fullPath) {
            return $fullPath && file_exists($fullPath);
        });

        if ([] === $fullPaths) {
            return [];
        }

        $files = SymfonyFinder::create()->files()->in($fullPaths)->depth(0)->name('/.*\.(ya?ml|php)$/i');

        // this sort helps to set an order with filename
        // ( "001-root-level-fixtures.yml", "002-another-level-fixtures.yml", ... )
        $files = $files->sort(function ($a, $b) {
            return strcasecmp($a, $b);
        });

        $fixtureFiles = [];

        foreach ($files as $file) {
            $fixtureFiles[$file->getRealPath()] = true;
        }

        return array_keys($fixtureFiles);
    }
private function doLocateFiles(string $path, string $environment): array
    {
        $fullPaths = array_filter(array_map(static function (string $fixturePath) use ($environment, $path): string {
            return '' !== $environment
                ? sprintf('%s/%s/%s', $path, $fixturePath, $environment)
                : sprintf('%s/%s', $path, $fixturePath);
        }, $this->fixturePaths), function ($fullPath) {
            return $fullPath && file_exists($fullPath);
        });

        if ([] === $fullPaths) {
            return [];
        }

        $files = SymfonyFinder::create()->files()->in($fullPaths)->depth(0)->name('/.*\.(ya?ml|php)$/i');

        // this sort helps to set an order with filename
        // ( "001-root-level-fixtures.yml", "002-another-level-fixtures.yml", ... )
        $files = $files->sort(function ($a, $b) {
            return strcasecmp($a, $b);
        });

        $fixtureFiles = [];

        foreach ($files as $file) {
            $fixtureFiles[$file->getRealPath()] = true;
        }

        return array_keys($fixtureFiles);
    }
private function doLocateFiles ( string $ path , string $ environment ) : array { $ fullPaths = array_filter ( array_map ( static function ( string $ fixturePath ) use ( $ environment , $ path ) : string { return '' !== $ environment ? sprintf ( '%s/%s/%s' , $ path , $ fixturePath , $ environment ) : sprintf ( '%s/%s' , $ path , $ fixturePath ) ; } , $ this -> fixturePaths ) , function ( $ fullPath ) { return $ fullPath && file_exists ( $ fullPath ) ; } ) ; if ( [ ] === $ fullPaths ) { return [ ] ; } $ files = SymfonyFinder :: create ( ) -> files ( ) -> in ( $ fullPaths ) -> depth ( 0 ) -> name ( '/.*\.(ya?ml|php)$/i' ) ; // this sort helps to set an order with filename // ( "001-root-level-fixtures.yml", "002-another-level-fixtures.yml", ... ) $ files = $ files -> sort ( function ( $ a , $ b ) { return strcasecmp ( $ a , $ b ) ; } ) ; $ fixtureFiles = [ ] ; foreach ( $ files as $ file ) { $ fixtureFiles [ $ file -> getRealPath ( ) ] = true ; } return array_keys ( $ fixtureFiles ) ; }
Gets the list of files that can be found in the given path.


@return string[]
Gets the list of files that can be found in the given path .