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.
Completed
Push — master ( 75bdf9...8faa57 )
by joseph
83:56 queued 81:04
created

ReflectionHelper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 48
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getFakerProviderFqnFromFieldTraitReflection() 0 13 1
A getEntityNamespaceRootFromEntityReflection() 0 7 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\CodeGeneration;
4
5
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Generator\AbstractGenerator;
6
7
class ReflectionHelper
8
{
9
10
    /**
11
     * @var NamespaceHelper
12
     */
13
    protected $namespaceHelper;
14
15 2
    public function __construct(NamespaceHelper $namespaceHelper)
16
    {
17 2
        $this->namespaceHelper = $namespaceHelper;
18 2
    }
19
20
    /**
21
     * @param \ts\Reflection\ReflectionClass $fieldTraitReflection
22
     *
23
     * @return string
24
     */
25 1
    public function getFakerProviderFqnFromFieldTraitReflection(\ts\Reflection\ReflectionClass $fieldTraitReflection
26
    ): string
27
    {
28 1
        return \str_replace(
29
            [
30 1
                '\\Traits\\',
31
                'FieldTrait',
32
            ],
33
            [
34 1
                '\\FakerData\\',
35
                'FakerData',
36
            ],
37 1
            $fieldTraitReflection->getName()
38
        );
39
    }
40
41
    /**
42
     * Work out the entity namespace root from a single entity reflection object.
43
     *
44
     * @param \ts\Reflection\ReflectionClass $entityReflection
45
     *
46
     * @return string
47
     */
48 1
    public function getEntityNamespaceRootFromEntityReflection(
49
        \ts\Reflection\ReflectionClass $entityReflection
50
    ): string {
51 1
        return $this->namespaceHelper->tidy(
52 1
            $this->namespaceHelper->getNamespaceRootToDirectoryFromFqn(
53 1
                $entityReflection->getName(),
54 1
                AbstractGenerator::ENTITIES_FOLDER_NAME
55
            )
56
        );
57
    }
58
}
59