| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function setUuid($uuid = null) |
||
| 40 | { |
||
| 41 | $notAllowedNames = [ |
||
| 42 | ListRepositoryInterface::CHUNK, |
||
| 43 | ListRepositoryInterface::HEADERS, |
||
| 44 | ListRepositoryInterface::INDEX, |
||
| 45 | ListRepositoryInterface::SEPARATOR, |
||
| 46 | ListRepositoryInterface::STATISTICS, |
||
| 47 | ]; |
||
| 48 | |||
| 49 | foreach ($notAllowedNames as $notAllowedName) { |
||
| 50 | if (strpos($uuid, $notAllowedName) !== false) { |
||
| 51 | throw new ListCollectionNotAllowedUuidException('You can\'t assign "'.$uuid.'" as list uuid.'); |
||
| 52 | } |
||
| 53 | } |
||
| 54 | |||
| 55 | $this->uuid = str_replace(' ', '-', $uuid) ?: Uuid::uuid4()->toString(); |
||
| 56 | } |
||
| 74 |