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

HydratorGenerationException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 3
crap 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