| Conditions | 2 |
| Paths | 2 |
| Total Lines | 27 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 23 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 24 | private static function init(): void |
|
| 35 | { |
||
| 36 | 24 | if (!is_null(self::$symbols)) { |
|
| 37 | 23 | return; |
|
| 38 | } |
||
| 39 | |||
| 40 | 1 | self::$symbols = (new Map('string', 'string')) |
|
| 41 | 1 | ->put('b', SignedOctet::class) |
|
|
1 ignored issue
–
show
|
|||
| 42 | 1 | ->put('B', UnsignedOctet::class) |
|
|
1 ignored issue
–
show
|
|||
| 43 | 1 | ->put('U', SignedShortInteger::class) |
|
|
1 ignored issue
–
show
|
|||
| 44 | 1 | ->put('u', UnsignedShortInteger::class) |
|
|
1 ignored issue
–
show
|
|||
| 45 | 1 | ->put('I', SignedLongInteger::class) |
|
|
1 ignored issue
–
show
|
|||
| 46 | 1 | ->put('i', UnsignedLongInteger::class) |
|
|
1 ignored issue
–
show
|
|||
| 47 | 1 | ->put('L', SignedLongLongInteger::class) |
|
|
1 ignored issue
–
show
|
|||
| 48 | 1 | ->put('l', UnsignedLongLongInteger::class) |
|
|
1 ignored issue
–
show
|
|||
| 49 | 1 | ->put('D', Decimal::class) |
|
|
1 ignored issue
–
show
|
|||
| 50 | 1 | ->put('T', Timestamp::class) |
|
|
1 ignored issue
–
show
|
|||
| 51 | 1 | ->put('V', VoidValue::class) |
|
|
1 ignored issue
–
show
|
|||
| 52 | 1 | ->put('t', Bits::class) |
|
|
1 ignored issue
–
show
|
|||
| 53 | 1 | ->put('s', ShortString::class) |
|
|
1 ignored issue
–
show
|
|||
| 54 | 1 | ->put('S', LongString::class) |
|
|
1 ignored issue
–
show
|
|||
| 55 | 1 | ->put('A', Sequence::class) |
|
|
1 ignored issue
–
show
|
|||
| 56 | 1 | ->put('F', Table::class); |
|
|
1 ignored issue
–
show
|
|||
| 57 | 1 | self::$classes = self::$symbols->map(static function(string $symbol, string $class): Pair { |
|
| 58 | 1 | return new Pair($class, $symbol); |
|
| 59 | 1 | }); |
|
| 60 | } |
||
| 61 | } |
||
| 62 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: