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: /**
15: * Class AbstractTypeConstraint.
16: *
17: * @author Eduardo Trujillo <ed@chromabits.com>
18: * @package Chromabits\Nucleus\Meditation\Constraints
19: */
20: abstract class AbstractTypeConstraint extends AbstractConstraint
21: {
22: /**
23: * Return whether the constraint is defined by an union of types.
24: *
25: * @return bool
26: */
27: public function isUnion()
28: {
29: return false;
30: }
31:
32: /**
33: * Get the description of the constraint.
34: *
35: * @return string
36: */
37: public function getDescription()
38: {
39: return vsprintf(
40: 'The value is expected to meet the type constraint: %s',
41: [$this->toString()]
42: );
43: }
44: }
45: