Passed
Pull Request — master (#33)
by Vincent
06:12
created

FieldNotDeclaredException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Bdf\Prime\Entity\Hydrator\Exception;
4
5
use InvalidArgumentException;
6
7
/**
8
 * Trying to access a field which is not declared on mapper
9
 */
10
class FieldNotDeclaredException extends InvalidArgumentException implements HydratorException
11
{
12
    /**
13
     * @param class-string $entity
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...
14
     * @param string $field
15
     */
16 8
    public function __construct(string $entity, string $field)
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before function; 0 found
Loading history...
17
    {
18 8
        parent::__construct('The field "' . $field . '" is not declared for the entity ' . $entity);
19 8
    }
20
}
21