Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
12 | 11 | public function build(AbstractModel $model) { |
|
13 | 11 | $this->sort($model); |
|
1 ignored issue
–
show
|
|||
14 | |||
15 | 11 | $this->buildHeader($model); |
|
1 ignored issue
–
show
|
|||
16 | |||
17 | // signature |
||
18 | 11 | $this->buildSignature($model); |
|
1 ignored issue
–
show
|
|||
19 | |||
20 | // body |
||
21 | 11 | $this->writer->writeln(" {\n")->indent(); |
|
22 | 11 | $this->buildTraits($model); |
|
1 ignored issue
–
show
|
|||
23 | 11 | $this->buildConstants($model); |
|
1 ignored issue
–
show
|
|||
24 | 11 | $this->buildProperties($model); |
|
1 ignored issue
–
show
|
|||
25 | 11 | $this->buildMethods($model); |
|
1 ignored issue
–
show
|
|||
26 | 11 | $this->writer->outdent()->rtrim()->write('}'); |
|
27 | 11 | } |
|
28 | |||
59 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.