1 | <?php |
||
18 | class Assertions |
||
19 | { |
||
20 | private $coerce; |
||
21 | |||
22 | 64 | /** |
|
23 | * Assertions constructor. |
||
24 | 64 | * |
|
25 | 64 | * @param \LesserPhp\Library\Coerce $coerce |
|
26 | */ |
||
27 | 2 | public function __construct(Coerce $coerce) |
|
31 | |||
32 | /** |
||
33 | * @param array $value |
||
34 | 2 | * @param string $error |
|
35 | * |
||
36 | * @return array |
||
37 | 4 | * @throws \LesserPhp\Exception\GeneralException |
|
38 | */ |
||
39 | 4 | public function assertColor(array $value, $error = 'expected color value') |
|
48 | |||
49 | /** |
||
50 | 2 | * @param array $value |
|
51 | * @param string $error |
||
52 | * |
||
53 | 2 | * @return mixed |
|
54 | 2 | * @throws \LesserPhp\Exception\GeneralException |
|
55 | 2 | */ |
|
56 | public function assertNumber(array $value, $error = 'expecting number') |
||
63 | |||
64 | /** |
||
65 | * @param array $value |
||
66 | * @param int $expectedArgs |
||
67 | * @param string $name |
||
68 | 4 | * |
|
69 | * @return array |
||
70 | * @throws \LesserPhp\Exception\GeneralException |
||
71 | 4 | */ |
|
72 | 4 | public function assertArgs(array $value, $expectedArgs, $name = '') |
|
92 | |||
93 | /** |
||
94 | * @param array $value |
||
95 | * @param int $expectedMinArgs |
||
96 | * @param string $name |
||
97 | * |
||
98 | * @return array |
||
99 | * @throws \LesserPhp\Exception\GeneralException |
||
100 | */ |
||
101 | public function assertMinArgs(array $value, $expectedMinArgs, $name = '') |
||
118 | } |
||
119 |