| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | protected function setValue(SimpleNumberInterface $realPart, SimpleNumberInterface $imaginaryPart) |
||
| 13 | { |
||
| 14 | $this->realPart = $realPart; |
||
|
|
|||
| 15 | $this->imaginaryPart = $imaginaryPart; |
||
| 16 | |||
| 17 | $this->cachedCartesian = new CartesianCoordinate($realPart, $imaginaryPart); |
||
| 18 | |||
| 19 | $polar = $this->cachedCartesian->asPolar(); |
||
| 20 | |||
| 21 | $this->values->set(0, $polar->getDistanceFromOrigin()); |
||
| 22 | $this->values->set(1, $polar->getPolarAngle()); |
||
| 23 | |||
| 24 | 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.