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

EntityRepositoryCreator::getEntityFqn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Src\Entity\Repositories;
4
5
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\AbstractCreator;
6
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\Creation\Process\ReplaceEntitiesSubNamespaceProcess;
7
8
class EntityRepositoryCreator extends AbstractCreator
9
{
10
    public const FIND_NAME     = 'TemplateEntityRepository';
11
    public const TEMPLATE_PATH = self::ROOT_TEMPLATE_PATH . '/src/Entity/Repositories/' . self::FIND_NAME . '.php';
12
    /**
13
     * @var string
14
     */
15
    private $entityFqn;
16
17 8
    public function configurePipeline(): void
18
    {
19 8
        parent::configurePipeline();
20 8
        $this->registerReplaceEntitiesNamespaceProcess();
21 8
        $this->registerEntityReplaceName($this->getEntityFqn());
22 8
    }
23
24 8
    protected function registerReplaceEntitiesNamespaceProcess(): void
25
    {
26 8
        $process = new ReplaceEntitiesSubNamespaceProcess();
27 8
        $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

27
        $process->setProjectRootNamespace(/** @scrutinizer ignore-type */ $this->projectRootNamespace);
Loading history...
28 8
        $process->setEntityFqn($this->getEntityFqn());
29 8
        $this->pipeline->register($process);
30 8
    }
31
32 8
    private function getEntityFqn(): string
33
    {
34 8
        return $this->entityFqn ?? $this->namespaceHelper->getEntityFqnFromEntityRepositoryFqn($this->newObjectFqn);
0 ignored issues
show
Bug introduced by
It seems like $this->newObjectFqn can also be of type null; however, parameter $entityRepositoryFqn of EdmondsCommerce\Doctrine...omEntityRepositoryFqn() 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
        return $this->entityFqn ?? $this->namespaceHelper->getEntityFqnFromEntityRepositoryFqn(/** @scrutinizer ignore-type */ $this->newObjectFqn);
Loading history...
35
    }
36
37 4
    public function setNewObjectFqnFromEntityFqn(string $entityFqn): self
38
    {
39 4
        $this->entityFqn    = $entityFqn;
40 4
        $this->newObjectFqn = $this->namespaceHelper->getRepositoryqnFromEntityFqn($entityFqn);
41
42 4
        return $this;
43
    }
44
}
45