@@ -11,5 +11,5 @@ |
||
| 11 | 11 | // --- PREAMBLE STOP --- |
| 12 | 12 | |
| 13 | 13 | // --- EXAMPLE START --- |
| 14 | -$list = [ 15, 17 ]; |
|
| 15 | -var_dump(IsInRange::using(10,20)->inspectList($list)); |
|
| 16 | 14 | \ No newline at end of file |
| 15 | +$list = [15, 17]; |
|
| 16 | +var_dump(IsInRange::using(10, 20)->inspectList($list)); |
|
| 17 | 17 | \ No newline at end of file |
@@ -11,5 +11,5 @@ |
||
| 11 | 11 | // --- PREAMBLE STOP --- |
| 12 | 12 | |
| 13 | 13 | // --- EXAMPLE START --- |
| 14 | -$list = [ 11, 15 ]; |
|
| 15 | -var_dump(IsInRange::checkList($list, 10,20)); |
|
| 16 | 14 | \ No newline at end of file |
| 15 | +$list = [11, 15]; |
|
| 16 | +var_dump(IsInRange::checkList($list, 10, 20)); |
|
| 17 | 17 | \ No newline at end of file |
@@ -14,8 +14,8 @@ |
||
| 14 | 14 | // --- EXAMPLE START --- |
| 15 | 15 | $rangeCheck = new IsInRange(10, 20); |
| 16 | 16 | |
| 17 | -$list1 = [ 11, 13 ]; |
|
| 18 | -$list2 = [ 5, 14 ]; |
|
| 17 | +$list1 = [11, 13]; |
|
| 18 | +$list2 = [5, 14]; |
|
| 19 | 19 | |
| 20 | 20 | var_dump($rangeCheck->inspectList($list1)); |
| 21 | 21 | var_dump($rangeCheck->inspectList($list2)); |
| 22 | 22 | \ No newline at end of file |
@@ -57,13 +57,37 @@ |
||
| 57 | 57 | */ |
| 58 | 58 | interface Throwable |
| 59 | 59 | { |
| 60 | + |
|
| 61 | + /** |
|
| 62 | + * @return string |
|
| 63 | + */ |
|
| 60 | 64 | public function getMessage(); |
| 61 | 65 | public function getCode(); |
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * @return string |
|
| 69 | + */ |
|
| 62 | 70 | public function getFile(); |
| 71 | + |
|
| 72 | + /** |
|
| 73 | + * @return integer |
|
| 74 | + */ |
|
| 63 | 75 | public function getLine(); |
| 64 | 76 | public function getTrace(); |
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * @return string |
|
| 80 | + */ |
|
| 65 | 81 | public function getTraceAsString(); |
| 82 | + |
|
| 83 | + /** |
|
| 84 | + * @return Exception |
|
| 85 | + */ |
|
| 66 | 86 | public function getPrevious(); |
| 87 | + |
|
| 88 | + /** |
|
| 89 | + * @return string |
|
| 90 | + */ |
|
| 67 | 91 | public function __toString(); |
| 68 | 92 | } |
| 69 | 93 | } |
@@ -69,9 +69,9 @@ |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | if (!class_exists('Error')) { |
| 72 | - /** |
|
| 73 | - * taken from: http://php.net/manual/en/class.error.php |
|
| 74 | - */ |
|
| 72 | + /** |
|
| 73 | + * taken from: http://php.net/manual/en/class.error.php |
|
| 74 | + */ |
|
| 75 | 75 | class Error extends Exception implements Throwable |
| 76 | 76 | { |
| 77 | 77 | public function __toString() |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | public function inspect($refProp) |
| 91 | 91 | { |
| 92 | 92 | // robustness! |
| 93 | - if (! $refProp instanceof ReflectionProperty) { |
|
| 93 | + if (!$refProp instanceof ReflectionProperty) { |
|
| 94 | 94 | throw new TypeError('$refProp is not a ReflectionProperty, is a ' . get_printable_type($refProp)); |
| 95 | 95 | } |
| 96 | 96 | return static::check($refProp); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | // --- EXAMPLE START --- |
| 13 | 13 | try { |
| 14 | - $list = 'hello, world!'; // this is not really a list! |
|
| 14 | + $list = 'hello, world!'; // this is not really a list! |
|
| 15 | 15 | check_is_array_list($list); |
| 16 | 16 | } |
| 17 | 17 | catch (TypeError $e) { |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | // --- EXAMPLE START --- |
| 13 | 13 | $list = [ |
| 14 | - [ 'hello, world!'], // this is okay |
|
| 14 | + ['hello, world!'], // this is okay |
|
| 15 | 15 | 'hello, world!' // this is not okay |
| 16 | 16 | ]; |
| 17 | 17 | $isArray = check_is_array_list($list); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | // --- EXAMPLE START --- |
| 13 | 13 | $list = [ |
| 14 | - [ 'hello, world!' ] |
|
| 14 | + ['hello, world!'] |
|
| 15 | 15 | ]; |
| 16 | 16 | $isArray = check_is_array_list($list); |
| 17 | 17 | var_dump($isArray); |
| 18 | 18 | \ No newline at end of file |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | * |
| 66 | 66 | * we don't support any customisations |
| 67 | 67 | * |
| 68 | - * @return IsClassPropertyList |
|
| 68 | + * @return IsListOfClassProperties |
|
| 69 | 69 | */ |
| 70 | 70 | public static function using() |
| 71 | 71 | { |