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.

PHPPropertyFileDirectory::fromPath()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 12
loc 12
rs 9.4285
cc 2
eloc 7
nc 2
nop 1
1
<?php
2
3
namespace UCD\Infrastructure\Repository\CharacterRepository\FileRepository\PropertyFile;
4
5
use UCD\Infrastructure\Repository\CharacterRepository\FileRepository\FileIterator;
6
use UCD\Infrastructure\Repository\CharacterRepository\FileRepository\Property;
7
use UCD\Infrastructure\Repository\CharacterRepository\FileRepository\PropertyFile;
8
use UCD\Infrastructure\Repository\CharacterRepository\FileRepository\PropertyFileDirectory;
9
use UCD\Infrastructure\Repository\CharacterRepository\FileRepository\PropertyFiles;
10
11 View Code Duplication
class PHPPropertyFileDirectory extends PropertyFileDirectory
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    /**
14
     * @param \SplFileInfo $basePath
15
     * @return PHPPropertyFileDirectory
16
     */
17
    public static function fromPath(\SplFileInfo $basePath)
18
    {
19
        $files = [];
20
        $fileInfos = FileIterator::fromPath($basePath);
21
22
        foreach ($fileInfos as $fileInfo) {
23
            $file = PHPPropertyFile::fromFileInfo($fileInfo);
24
            array_push($files, $file);
25
        }
26
27
        return new self($basePath, new PropertyFiles($files));
28
    }
29
30
    /**
31
     * @param Property $property
32
     * @return PropertyFile
33
     */
34
    protected function createFileForProperty(Property $property)
35
    {
36
        return PHPPropertyFile::fromProperty($this->basePath, $property);
37
    }
38
}