PreSerializeEvent::setType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JMS\Serializer\EventDispatcher;
6
7
class PreSerializeEvent extends ObjectEvent
8
{
9
    public function setType(string $typeName, array $params = []): void
10
    {
11
        $this->type = ['name' => $typeName, 'params' => $params];
0 ignored issues
show
Documentation Bug introduced by
It seems like array('name' => $typeName, 'params' => $params) of type array<string,array|string> is incompatible with the declared type JMS\Serializer\EventDispatcher\TypeArray of property $type.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
12
    }
13
}
14