| @@ 800-813 (lines=14) @@ | ||
| 797 | * |
|
| 798 | * @return bool |
|
| 799 | */ |
|
| 800 | public function matches(\Closure $closure) |
|
| 801 | { |
|
| 802 | // Reduce the array to only booleans |
|
| 803 | $array = $this->each($closure); |
|
| 804 | ||
| 805 | // Check the results |
|
| 806 | if (count($array) === 0) { |
|
| 807 | return true; |
|
| 808 | } |
|
| 809 | ||
| 810 | $array = array_search(false, $array->toArray(), false); |
|
| 811 | ||
| 812 | return is_bool($array); |
|
| 813 | } |
|
| 814 | ||
| 815 | /** |
|
| 816 | * Unset an offset. |
|
| @@ 860-873 (lines=14) @@ | ||
| 857 | * |
|
| 858 | * @return bool |
|
| 859 | */ |
|
| 860 | public function matchesAny(\Closure $closure) |
|
| 861 | { |
|
| 862 | // Reduce the array to only booleans |
|
| 863 | $array = $this->each($closure); |
|
| 864 | ||
| 865 | // Check the results |
|
| 866 | if (count($array) === 0) { |
|
| 867 | return true; |
|
| 868 | } |
|
| 869 | ||
| 870 | $array = array_search(true, $array->toArray(), false); |
|
| 871 | ||
| 872 | return is_int($array); |
|
| 873 | } |
|
| 874 | ||
| 875 | /** |
|
| 876 | * Check if we have named keys in the current array. |
|