1 | <?php |
||
15 | class AssertionFailedException extends \Exception |
||
16 | { |
||
17 | private $propertyPath; |
||
18 | private $value; |
||
19 | private $constraints; |
||
20 | private $level; |
||
21 | |||
22 | public function __construct($message, $code, $propertyPath = null, $value, array $constraints = [], $level='critical') |
||
30 | /** |
||
31 | * User controlled way to define a sub-property causing |
||
32 | * the failure of a currently asserted objects. |
||
33 | * |
||
34 | * Useful to transport information about the nature of the error |
||
35 | * back to higher layers. |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | public function getPropertyPath() |
||
44 | |||
45 | /** |
||
46 | * @return null|string |
||
47 | */ |
||
48 | public function getProperty() |
||
52 | |||
53 | /** |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getLevel() |
||
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | protected function getCallingFileAndLine() |
||
82 | |||
83 | /** |
||
84 | * Get the value that caused the assertion to fail. |
||
85 | * |
||
86 | * @return mixed |
||
87 | */ |
||
88 | public function getValue() |
||
92 | /** |
||
93 | * Get the constraints that applied to the failed assertion. |
||
94 | * |
||
95 | * @return array |
||
96 | */ |
||
97 | public function getConstraints() |
||
101 | |||
102 | public static function afterLast($needle, $haystack, $return_original=false) |
||
110 | |||
111 | public static function strrevpos($string, $needle) |
||
116 | |||
117 | public static function beforeLast($needle, $haystack) |
||
121 | } |
||
122 |