GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

FileLocator::locateFiles()   A
last analyzed

Complexity

Conditions 4
Paths 3

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.568
c 0
b 0
f 0
cc 4
nc 3
nop 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Al\ResourceManagement\Infrastructure\Persistence\Doctrine\Fixtures;
5
6
use Hautelook\AliceBundle\FixtureLocatorInterface;
7
use Symfony\Component\Finder\Finder as SymfonyFinder;
8
9
final class FileLocator implements FixtureLocatorInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function locateFiles(array $bundles, string $environment): array
15
    {
16
        $path = sprintf('%s/../Resources/fixtures', __DIR__);
17
        $path = realpath($path);
18
        if (false === $path || false === file_exists($path)) {
19
            return [];
20
        }
21
22
        $files = SymfonyFinder::create()->files()->in($path)->depth(0)->name('/.*\.(ya?ml|php)$/i');
23
24
        // this sort helps to set an order with filename ( "001-root-level-fixtures.yml", "002-another-level-fixtures.yml", ... )
25
        $files = $files->sort(function ($a, $b) {
26
            return strcasecmp($a, $b);
27
        });
28
29
        $fixtureFiles = [];
30
        foreach ($files as $file) {
31
            $fixtureFiles[] = $file->getRealPath();
32
        }
33
34
        return $fixtureFiles;
35
    }
36
}
37