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

FieldNotDeclaredException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 9
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 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