1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10:
11:
12: namespace Chromabits\Nucleus\Meditation\Constraints;
13:
14: use ArrayObject;
15: use Chromabits\Nucleus\Data\Interfaces\ListInterface;
16: use Chromabits\Nucleus\Meditation\Primitives\CompoundTypes;
17:
18: 19: 20: 21: 22: 23:
24: class ListConstraint extends EitherConstraint
25: {
26: 27: 28:
29: public function __construct()
30: {
31: parent::__construct(
32: new ClassTypeConstraint(ListInterface::class),
33: new EitherConstraint(
34: new ClassTypeConstraint(ArrayObject::class),
35: new PrimitiveTypeConstraint(CompoundTypes::COMPOUND_ARRAY)
36: )
37: );
38: }
39: }
40: