Passed
Push — master ( 36d135...97e9b8 )
by Sébastien
08:13
created

HydratorGenerationException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
c 0
b 0
f 0
dl 0
loc 29
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A entityClass() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace Bdf\Prime\Entity\Hydrator\Exception;
4
5
use LogicException;
6
use Throwable;
7
8
/**
9
 * Exception raised when the entity hydrator cannot be generated
10
 */
11
class HydratorGenerationException extends LogicException implements HydratorException
12
{
13
    /**
14
     * @var class-string
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string.
Loading history...
introduced by
Expected "classstring" but found "class-string" for @var tag in member variable comment
Loading history...
15
     */
16
    private $entityClass;
17
18
    /**
19
     * HydratorException constructor.
20
     *
21
     * @param class-string $entityClass
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string.
Loading history...
introduced by
Expected "classstring" but found "class-string" for parameter type
Loading history...
22
     * @param string $message
23
     * @param Throwable|null $previous
24
     */
25 3
    public function __construct(string $entityClass, string $message = '', ?Throwable $previous = null)
26
    {
27 3
        parent::__construct($entityClass . ' : ' . $message, 0, $previous);
28
29 3
        $this->entityClass = $entityClass;
30 3
    }
31
32
    /**
33
     * Get the entity class name
34
     *
35
     * @return class-string
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string.
Loading history...
introduced by
Expected "classstring" but found "class-string" for function return type
Loading history...
36
     */
37 1
    public function entityClass(): string
38
    {
39 1
        return $this->entityClass;
40
    }
41
}
42