| Conditions | 6 |
| Paths | 6 |
| Total Lines | 27 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function resolvePropertyValue(\ReflectionProperty $property) |
||
| 27 | { |
||
| 28 | $propertyType = $property->getType(); |
||
|
|
|||
| 29 | Assert::isInstanceOf($propertyType, \ReflectionNamedType::class); |
||
| 30 | |||
| 31 | switch ($propertyType->getName()) { |
||
| 32 | case 'string': |
||
| 33 | try { |
||
| 34 | $value = $this->faker->{$property->getName()}; |
||
| 35 | } catch (\Throwable $t) { |
||
| 36 | $value = $this->faker->word; |
||
| 37 | } |
||
| 38 | break; |
||
| 39 | case 'int': |
||
| 40 | $value = $this->faker->randomDigit; |
||
| 41 | break; |
||
| 42 | case 'bool': |
||
| 43 | $value = $this->faker->boolean; |
||
| 44 | break; |
||
| 45 | case 'DateTime': |
||
| 46 | $value = $this->faker->dateTime->format('Y-m-d H:i'); |
||
| 47 | break; |
||
| 48 | default: |
||
| 49 | $value = null; |
||
| 50 | } |
||
| 51 | |||
| 52 | return $value; |
||
| 53 | } |
||
| 55 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.