Example #1
0
 /**
  * Construct an instance of a MapConstraint.
  */
 public function __construct()
 {
     parent::__construct(new ClassTypeConstraint(MapInterface::class), new EitherConstraint(new ListConstraint(), new ClassTypeConstraint(ArrayAccess::class)));
 }
Example #2
0
 /**
  * Construct an instance of a ListConstraint.
  */
 public function __construct()
 {
     parent::__construct(new ClassTypeConstraint(ListInterface::class), new EitherConstraint(new ClassTypeConstraint(ArrayObject::class), new PrimitiveTypeConstraint(CompoundTypes::COMPOUND_ARRAY)));
 }
 /**
  * Construct an instance of a TraversableConstraint.
  */
 public function __construct()
 {
     parent::__construct(new ClassTypeConstraint(FoldableInterface::class), new ListConstraint());
 }
 /**
  * Construct an instance of a TraversableConstraint.
  */
 public function __construct()
 {
     parent::__construct(new ClassTypeConstraint(LeftFoldableInterface::class), new EitherConstraint(new ListConstraint(), new ClassTypeConstraint(Traversable::class)));
 }
Example #5
0
 /**
  * Construct an instance of a ListConstraint.
  */
 public function __construct()
 {
     parent::__construct(new LeftFoldableConstraint(), new MapConstraint());
 }
Example #6
0
 /**
  * Construct an instance of a MaybeConstraint.
  *
  * @param AbstractConstraint $other
  */
 public function __construct(AbstractConstraint $other)
 {
     parent::__construct($other, new PrimitiveTypeConstraint(SpecialTypes::SPECIAL_NULL));
 }