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 ( 6592ea...1bf5ed )
by joseph
31s queued 13s
created

EntityCreator   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A configurePipeline() 0 6 2
A registerReplaceEntitiesNamespaceProcess() 0 6 1
A setReplaceIdFieldProcess() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Src\Entities;
4
5
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\AbstractCreator;
6
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\CreatorInterface;
7
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Process\ReplaceEntitiesSubNamespaceProcess;
8
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Process\ReplaceEntityIdFieldProcess;
9
10
class EntityCreator extends AbstractCreator
11
{
12
    public const FIND_NAME = 'TemplateEntity';
13
14
    public const TEMPLATE_PATH = self::ROOT_TEMPLATE_PATH . '/' . CreatorInterface::SRC_FOLDER . '/Entities/'
15
                                 . self::FIND_NAME . '.php';
16
17
    /**
18
     * @var ReplaceEntityIdFieldProcess|null
19
     */
20
    private $replaceIdFieldProcess;
21
22 3
    public function configurePipeline(): void
23
    {
24 3
        parent::configurePipeline();
25 3
        $this->registerReplaceEntitiesNamespaceProcess();
26 3
        if (null !== $this->replaceIdFieldProcess) {
27 1
            $this->pipeline->register($this->replaceIdFieldProcess);
28
        }
29 3
    }
30
31 3
    private function registerReplaceEntitiesNamespaceProcess(): void
32
    {
33 3
        $process = new ReplaceEntitiesSubNamespaceProcess();
34 3
        $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

34
        $process->setProjectRootNamespace(/** @scrutinizer ignore-type */ $this->projectRootNamespace);
Loading history...
35 3
        $process->setEntityFqn($this->newObjectFqn);
0 ignored issues
show
Bug introduced by
It seems like $this->newObjectFqn can also be of type null; however, parameter $entityFqn of EdmondsCommerce\Doctrine...Process::setEntityFqn() 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

35
        $process->setEntityFqn(/** @scrutinizer ignore-type */ $this->newObjectFqn);
Loading history...
36 3
        $this->pipeline->register($process);
37 3
    }
38
39
    /**
40
     * If you want to replace the ID field, you must set a preconfigured replace process object using this method
41
     *
42
     * @param ReplaceEntityIdFieldProcess $replaceIdFieldProcess
43
     *
44
     * @return EntityCreator
45
     */
46 1
    public function setReplaceIdFieldProcess(ReplaceEntityIdFieldProcess $replaceIdFieldProcess): EntityCreator
47
    {
48 1
        $this->replaceIdFieldProcess = $replaceIdFieldProcess;
49
50 1
        return $this;
51
    }
52
}
53