| Conditions | 4 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function __construct($collectionClass, MajoraNormalizer $normalizer, Clock $clock) |
||
| 31 | { |
||
| 32 | if (empty($collectionClass) || !class_exists($collectionClass)) { |
||
| 33 | throw new \InvalidArgumentException(sprintf( |
||
| 34 | 'You must provide a valid EntityCollection class name, "%s" given.', |
||
| 35 | $collectionClass |
||
| 36 | )); |
||
| 37 | } |
||
| 38 | $this->entityCollection = new $collectionClass(); |
||
| 39 | if (!$this->entityCollection instanceof EntityCollection) { |
||
| 40 | throw new \InvalidArgumentException(sprintf( |
||
| 41 | 'Provided class name is not an Majora\Framework\Model\EntityCollection, "%s" given.', |
||
| 42 | $collectionClass |
||
| 43 | )); |
||
| 44 | } |
||
| 45 | |||
| 46 | $this->normalizer = $normalizer; |
||
| 47 | $this->clock = $clock; |
||
| 48 | } |
||
| 49 | |||
| 66 |