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 (#154)
by joseph
26:39
created

EntityUnitOfWorkHelperCreator   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A configurePipeline() 0 5 1
A registerReplaceEntitiesNamespaceProcess() 0 6 1
A setNewObjectFqnFromEntityFqn() 0 6 1
A getEntityFqn() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Src\Entity\Savers;
4
5
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\AbstractCreator;
6
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Process\ReplaceEntitiesSubNamespaceProcess;
7
8
class EntityUnitOfWorkHelperCreator extends AbstractCreator
9
{
10
    public const FIND_NAME = 'TemplateEntityUnitOfWorkHelper';
11
12
    public const TEMPLATE_PATH = self::ROOT_TEMPLATE_PATH . '/src/Entity/Savers/' . self::FIND_NAME . '.php';
13
    /**
14
     * @var string
15
     */
16
    private $entityFqn;
17
18
    public function configurePipeline(): void
19
    {
20
        parent::configurePipeline();
21
        $this->registerReplaceEntitiesNamespaceProcess();
22
        $this->registerEntityReplaceName($this->getEntityFqn());
23
    }
24
25
    public function setNewObjectFqnFromEntityFqn(string $entityFqn): self
26
    {
27
        $this->entityFqn    = $entityFqn;
28
        $this->newObjectFqn = $this->namespaceHelper->getEntityUnitOfWorkHelperFqnFromEntityFqn($entityFqn);
29
30
        return $this;
31
    }
32
33
    protected function registerReplaceEntitiesNamespaceProcess(): void
34
    {
35
        $process = new ReplaceEntitiesSubNamespaceProcess();
36
        $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

36
        $process->setProjectRootNamespace(/** @scrutinizer ignore-type */ $this->projectRootNamespace);
Loading history...
37
        $process->setEntityFqn($this->getEntityFqn());
38
        $this->pipeline->register($process);
39
    }
40
41
    private function getEntityFqn(): string
42
    {
43
        return $this->entityFqn ??
44
            $this->namespaceHelper->getEntityFqnFromEntityUnitOfWorkHelperFqn($this->newObjectFqn);
0 ignored issues
show
Bug introduced by
It seems like $this->newObjectFqn can also be of type null; however, parameter $entityUnitofWorkHelperFqn of EdmondsCommerce\Doctrine...tyUnitOfWorkHelperFqn() 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

44
            $this->namespaceHelper->getEntityFqnFromEntityUnitOfWorkHelperFqn(/** @scrutinizer ignore-type */ $this->newObjectFqn);
Loading history...
45
    }
46
}
47