| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | 1 | protected function setValue(SimpleNumberInterface $realPart, SimpleNumberInterface $imaginaryPart) |
|
| 13 | { |
||
| 14 | 1 | $this->realPart = $realPart; |
|
|
|
|||
| 15 | 1 | $this->imaginaryPart = $imaginaryPart; |
|
| 16 | |||
| 17 | 1 | $this->cachedCartesian = new CartesianCoordinate($realPart, $imaginaryPart); |
|
| 18 | |||
| 19 | 1 | $polar = $this->cachedCartesian->asPolar(); |
|
| 20 | |||
| 21 | 1 | $this->values->set(0, $polar->getDistanceFromOrigin()); |
|
| 22 | 1 | $this->values->set(1, $polar->getPolarAngle()); |
|
| 23 | |||
| 24 | 1 | return $this; |
|
| 25 | } |
||
| 27 | } |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.