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

setNewObjectFqnFromEntityFqn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Src\Entity\Factories;
6
7
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\AbstractCreator;
8
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Process\ReplaceEntitiesSubNamespaceProcess;
9
10
class EntityFactoryCreator extends AbstractCreator
11
{
12
    public const FIND_NAME = 'TemplateEntityFactory';
13
14
    public const TEMPLATE_PATH = self::ROOT_TEMPLATE_PATH . '/src/Entity/Factories/' . self::FIND_NAME . '.php';
15
    /**
16
     * @var string
17
     */
18
    private $entityFqn;
19
20
    public function configurePipeline(): void
21
    {
22
        parent::configurePipeline();
23
        $this->registerReplaceEntitiesNamespaceProcess();
24
        $this->registerEntityReplaceName($this->getEntityFqn());
25
    }
26
27
    protected function registerReplaceEntitiesNamespaceProcess(): void
28
    {
29
        $process = new ReplaceEntitiesSubNamespaceProcess();
30
        $process->setEntityFqn($this->getEntityFqn());
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
        $this->pipeline->register($process);
33
    }
34
35
    private function getEntityFqn(): string
36
    {
37
        return $this->entityFqn ?? $this->namespaceHelper->getEntityFqnFromEntityFactoryFqn($this->newObjectFqn);
0 ignored issues
show
Bug introduced by
It seems like $this->newObjectFqn can also be of type null; however, parameter $entityFactoryFqn of EdmondsCommerce\Doctrine...nFromEntityFactoryFqn() 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

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