FieldTypeNotFoundException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 10
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LAG\AdminBundle\Exception\Field;
6
7
class FieldTypeNotFoundException extends FieldException
8
{
9
    public function __construct(string $type, string $fieldName, array $context = [])
10
    {
11
        $message = sprintf(
12
            'The type "%s" is not configured for the Field "%s" with context "%s"',
13
            $type,
14
            $fieldName,
15
            print_r($context, true)
0 ignored issues
show
Bug introduced by
It seems like print_r($context, true) can also be of type true; however, parameter $values of sprintf() does only seem to accept double|integer|string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

15
            /** @scrutinizer ignore-type */ print_r($context, true)
Loading history...
16
        );
17
18
        parent::__construct($message, 500);
19
    }
20
}
21