Conditions | 4 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
28 | 28 | public function onPreSave(ContainerInterface $provider, $subject, \ReflectionProperty $property) |
|
29 | { |
||
30 | 28 | $val = $property->getValue($subject); |
|
31 | |||
32 | 28 | if ($val === null || ($val instanceof UserRecord && empty($val->getName()))) { |
|
33 | |||
34 | /** @var UserRecordProvider $creator */ |
||
35 | 28 | $creator = $this->getService($provider); |
|
36 | |||
37 | 28 | $property->setValue($subject, $creator->getUserRecord()); |
|
38 | } |
||
39 | 28 | } |
|
40 | } |
||
41 |