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
Pull Request — master (#221)
by joseph
19:29
created

EntityFixtureCreator   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 37
ccs 0
cts 17
cp 0
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A registerReplaceEntitiesNamespaceProcess() 0 6 1
A setNewObjectFqnFromEntityFqn() 0 6 1
A getEntityFqn() 0 3 1
A configurePipeline() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Tests\Assets\Entity\Fixtures;
6
7
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\AbstractCreator;
8
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Process\ReplaceEntitiesSubNamespaceProcess;
9
10
class EntityFixtureCreator extends AbstractCreator
11
{
12
    public const FIND_NAME = 'TemplateEntityFixture';
13
14
    public const TEMPLATE_PATH = self::ROOT_TEMPLATE_PATH . 'tests/Assets/Entity/Fixtures/' . self::FIND_NAME . '.php';
15
16
    /**
17
     * @var string
18
     */
19
    private $entityFqn;
20
21
    public function configurePipeline(): void
22
    {
23
        parent::configurePipeline();
24
        $this->registerReplaceEntitiesNamespaceProcess();
25
        $this->registerEntityReplaceName($this->getEntityFqn());
26
    }
27
28
    protected function registerReplaceEntitiesNamespaceProcess(): void
29
    {
30
        $process = new ReplaceEntitiesSubNamespaceProcess();
31
        $process->setProjectRootNamespace($this->projectRootNamespace);
0 ignored issues
show
Bug introduced by
It seems like $this->projectRootNamespace can also be of type null; however, parameter $projectRootNamespace of EdmondsCommerce\Doctrine...tProjectRootNamespace() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

31
        $process->setProjectRootNamespace(/** @scrutinizer ignore-type */ $this->projectRootNamespace);
Loading history...
32
        $process->setEntityFqn($this->getEntityFqn());
33
        $this->pipeline->register($process);
34
    }
35
36
    protected function getEntityFqn(): string
37
    {
38
        return $this->entityFqn ?? $this->namespaceHelper->getEntityFqnFromFixtureFqn($this->newObjectFqn);
0 ignored issues
show
Bug introduced by
It seems like $this->newObjectFqn can also be of type null; however, parameter $fixtureFqn of EdmondsCommerce\Doctrine...tityFqnFromFixtureFqn() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

38
        return $this->entityFqn ?? $this->namespaceHelper->getEntityFqnFromFixtureFqn(/** @scrutinizer ignore-type */ $this->newObjectFqn);
Loading history...
39
    }
40
41
    public function setNewObjectFqnFromEntityFqn(string $entityFqn): self
42
    {
43
        $this->entityFqn    = $entityFqn;
44
        $this->newObjectFqn = $this->namespaceHelper->getFixtureFqnFromEntityFqn($entityFqn);
45
46
        return $this;
47
    }
48
}
49