Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.0218 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | 1 | public static function create(string $entityClassName): self |
|
16 | { |
||
17 | 1 | $self = new self(); |
|
18 | 1 | $valueResolver = new FakerValueResolver(Factory::create()); |
|
19 | |||
20 | 1 | foreach ((new \ReflectionClass($entityClassName))->getProperties() as $property) { |
|
21 | if ( |
||
22 | 1 | 'id' === $property->getName() || |
|
23 | 1 | null === $value = $valueResolver->resolvePropertyValue($property) |
|
24 | ) { |
||
25 | continue; |
||
26 | } |
||
27 | |||
28 | 1 | $self->{$property->getName()} = $value; |
|
29 | } |
||
30 | |||
31 | 1 | return $self; |
|
32 | } |
||
34 |