| @@ 830-843 (lines=14) @@ | ||
| 827 | * |
|
| 828 | * @return bool |
|
| 829 | */ |
|
| 830 | public function matches(\Closure $closure) |
|
| 831 | { |
|
| 832 | // Reduce the array to only booleans |
|
| 833 | $array = $this->each($closure); |
|
| 834 | ||
| 835 | // Check the results |
|
| 836 | if (count($array) === 0) { |
|
| 837 | return true; |
|
| 838 | } |
|
| 839 | ||
| 840 | $array = array_search(false, $array->toArray(), false); |
|
| 841 | ||
| 842 | return is_bool($array); |
|
| 843 | } |
|
| 844 | ||
| 845 | /** |
|
| 846 | * Iterate over the current array and modify the array's value. |
|
| @@ 878-891 (lines=14) @@ | ||
| 875 | * |
|
| 876 | * @return bool |
|
| 877 | */ |
|
| 878 | public function matchesAny(\Closure $closure) |
|
| 879 | { |
|
| 880 | // Reduce the array to only booleans |
|
| 881 | $array = $this->each($closure); |
|
| 882 | ||
| 883 | // Check the results |
|
| 884 | if (count($array) === 0) { |
|
| 885 | return true; |
|
| 886 | } |
|
| 887 | ||
| 888 | $array = array_search(true, $array->toArray(), false); |
|
| 889 | ||
| 890 | return is_int($array); |
|
| 891 | } |
|
| 892 | ||
| 893 | /** |
|
| 894 | * Check whether array is associative or not. |
|