Conditions | 3 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | private function createDomainId(Closure $objectIdExists) |
||
18 | { |
||
19 | $numTries = 0; |
||
20 | |||
21 | do { |
||
22 | $domainId = new DomainId(); |
||
23 | |||
24 | if ($numTries++ >= 10) { |
||
25 | throw new FatalError('Failed to generate a unique identifier.'); |
||
26 | } |
||
27 | } while (call_user_func($objectIdExists, $domainId->getValue())); |
||
28 | |||
29 | return $domainId; |
||
30 | } |
||
31 | } |
||
32 |