| @@ 810-823 (lines=14) @@ | ||
| 807 | * |
|
| 808 | * @return bool |
|
| 809 | */ |
|
| 810 | public function matches(\Closure $closure) |
|
| 811 | { |
|
| 812 | // Reduce the array to only booleans |
|
| 813 | $array = $this->each($closure); |
|
| 814 | ||
| 815 | // Check the results |
|
| 816 | if (count($array) === 0) { |
|
| 817 | return true; |
|
| 818 | } |
|
| 819 | ||
| 820 | $array = array_search(false, $array->toArray(), false); |
|
| 821 | ||
| 822 | return is_bool($array); |
|
| 823 | } |
|
| 824 | ||
| 825 | /** |
|
| 826 | * Iterate over the current array and modify the array's value. |
|
| @@ 858-871 (lines=14) @@ | ||
| 855 | * |
|
| 856 | * @return bool |
|
| 857 | */ |
|
| 858 | public function matchesAny(\Closure $closure) |
|
| 859 | { |
|
| 860 | // Reduce the array to only booleans |
|
| 861 | $array = $this->each($closure); |
|
| 862 | ||
| 863 | // Check the results |
|
| 864 | if (count($array) === 0) { |
|
| 865 | return true; |
|
| 866 | } |
|
| 867 | ||
| 868 | $array = array_search(true, $array->toArray(), false); |
|
| 869 | ||
| 870 | return is_int($array); |
|
| 871 | } |
|
| 872 | ||
| 873 | /** |
|
| 874 | * Check whether array is associative or not. |
|