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   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 30
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRepository() 0 5 1
A __construct() 0 8 1
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