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.

RepositoryFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
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 3
dl 0
loc 8
ccs 0
cts 8
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\Entity\Repositories;
6
7
use Doctrine\ORM\EntityManagerInterface;
8
use EdmondsCommerce\DoctrineStaticMeta\CodeGeneration\NamespaceHelper;
9
use EdmondsCommerce\DoctrineStaticMeta\Entity\Factory\EntityFactory;
10
use EdmondsCommerce\DoctrineStaticMeta\Entity\Factory\EntityFactoryInterface;
11
12
class RepositoryFactory
13
{
14
    /**
15
     * @var NamespaceHelper
16
     */
17
    protected $namespaceHelper;
18
    /**
19
     * @var EntityManagerInterface
20
     */
21
    protected $entityManager;
22
    /**
23
     * @var EntityFactoryInterface
24
     */
25
    private $entityFactory;
26
27
    public function __construct(
28
        EntityManagerInterface $entityManager,
29
        NamespaceHelper $namespaceHelper,
30
        EntityFactoryInterface $entityFactory
31
    ) {
32
        $this->entityManager   = $entityManager;
33
        $this->namespaceHelper = $namespaceHelper;
34
        $this->entityFactory   = $entityFactory;
35
    }
36
37
    public function getRepository(string $entityFqn): EntityRepositoryInterface
38
    {
39
        $repositoryFqn = $this->namespaceHelper->getRepositoryqnFromEntityFqn($entityFqn);
40
41
        return new $repositoryFqn($this->entityManager, $this->entityFactory, $this->namespaceHelper);
42
    }
43
}
44