| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function getArguments(string $mailableClass, array $defaultValues) |
||
| 31 | { |
||
| 32 | $parameters = (new ReflectionClass($mailableClass)) |
||
| 33 | ->getConstructor() |
||
| 34 | ->getParameters(); |
||
| 35 | |||
| 36 | return collect($parameters) |
||
| 37 | ->map(function (ReflectionParameter $reflectionParameter) use ($mailableClass, $defaultValues) { |
||
| 38 | return $this->argumentValueProvider->getValue( |
||
| 39 | $mailableClass, |
||
| 40 | $reflectionParameter->getName(), |
||
| 41 | $reflectionParameter->getType()->getName(), |
||
| 42 | $defaultValues[$reflectionParameter->getName()] ?? null |
||
| 43 | ); |
||
| 44 | }); |
||
| 45 | } |
||
| 46 | |||
| 56 |
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.