| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 61 | 162 | private function getOrCreateStory(string $class): Story |
|
| 62 | { |
||
| 63 | 162 | foreach ($this->stories as $story) { |
|
| 64 | 82 | if ($class === \get_class($story)) { |
|
| 65 | 2 | return $story; |
|
| 66 | } |
||
| 67 | } |
||
| 68 | |||
| 69 | // todo better error if story has constructor argument(s) but not registered as a service |
||
| 70 | 162 | return new $class(); |
|
| 71 | } |
||
| 73 |
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..