ObjectRepositoryType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getEntityClass() 0 3 1
A describe() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Mapado\RestClientSdk\PHPStan\Type;
6
7
use PHPStan\Type\ObjectType;
0 ignored issues
show
Bug introduced by
The type PHPStan\Type\ObjectType was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use PHPStan\Type\VerbosityLevel;
0 ignored issues
show
Bug introduced by
The type PHPStan\Type\VerbosityLevel was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
class ObjectRepositoryType extends ObjectType
11
{
12
    /** @var string */
13
    private $entityClass;
14
15
    public function __construct(string $entityClass, string $repositoryClass)
16
    {
17
        parent::__construct($repositoryClass);
18
        $this->entityClass = $entityClass;
19
    }
20
21
    public function getEntityClass(): string
22
    {
23
        return $this->entityClass;
24
    }
25
26
    public function describe(VerbosityLevel $level): string
27
    {
28
        return sprintf('%s<%s>', parent::describe($level), $this->entityClass);
29
    }
30
}
31