1: <?php
2:
3: /**
4: * Copyright 2015, Eduardo Trujillo
5: *
6: * For the full copyright and license information, please view the LICENSE
7: * file that was distributed with this source code.
8: *
9: * This file is part of the Nucleus package
10: */
11:
12: namespace Chromabits\Nucleus\Meditation\Constraints;
13:
14: use Chromabits\Nucleus\Data\Interfaces\FunctorInterface;
15: use Traversable;
16:
17: /**
18: * Class TraversableConstraint.
19: *
20: * @author Eduardo Trujillo <ed@chromabits.com>
21: * @package Chromabits\Nucleus\Meditation\Constraints
22: */
23: class FunctorConstraint extends EitherConstraint
24: {
25: /**
26: * Construct an instance of a TraversableConstraint.
27: */
28: public function __construct()
29: {
30: parent::__construct(
31: new ClassTypeConstraint(FunctorInterface::class),
32: new EitherConstraint(
33: new ListConstraint(),
34: new ClassTypeConstraint(Traversable::class)
35: )
36: );
37: }
38: }
39: