コード例 #1
0
ファイル: MapConstraint.php プロジェクト: chromabits/nucleus
 /**
  * Construct an instance of a MapConstraint.
  */
 public function __construct()
 {
     parent::__construct(new ClassTypeConstraint(MapInterface::class), new EitherConstraint(new ListConstraint(), new ClassTypeConstraint(ArrayAccess::class)));
 }
コード例 #2
0
ファイル: ListConstraint.php プロジェクト: chromabits/nucleus
 /**
  * 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)));
 }
コード例 #3
0
 /**
  * Construct an instance of a TraversableConstraint.
  */
 public function __construct()
 {
     parent::__construct(new ClassTypeConstraint(FoldableInterface::class), new ListConstraint());
 }
コード例 #4
0
 /**
  * Construct an instance of a TraversableConstraint.
  */
 public function __construct()
 {
     parent::__construct(new ClassTypeConstraint(LeftFoldableInterface::class), new EitherConstraint(new ListConstraint(), new ClassTypeConstraint(Traversable::class)));
 }
コード例 #5
0
 /**
  * Construct an instance of a ListConstraint.
  */
 public function __construct()
 {
     parent::__construct(new LeftFoldableConstraint(), new MapConstraint());
 }
コード例 #6
0
 /**
  * Construct an instance of a MaybeConstraint.
  *
  * @param AbstractConstraint $other
  */
 public function __construct(AbstractConstraint $other)
 {
     parent::__construct($other, new PrimitiveTypeConstraint(SpecialTypes::SPECIAL_NULL));
 }