Anemone::any()
Checks if at least one item in the data passes the test.
Table of Contents
Description
Anemone::any(callable $fn): bool;
Anemone::any(mixed $value): bool;
This is the OOP style of function any()
, implemented as a class method. It returns true
if, in the data, it finds an item for which the provided function returns true
, otherwise it returns false
. It does not modify the data.
Example
$anemone = new Anemone([1, 2, 3, 4, 5]);
if ($anemone->any(function ($v) {
return 4 === $v;
})) {
// There is at least one item in the `$anemone` with a value of `4`
}
For a simple return of value, you can summarize the call as in the example below:
if ($anemone->any(4)) {
// There is at least one item in the `$anemone` with a value of `4`
}
Anemone::_()
The dynamic method initiator.
Anemone::__call()
Proxy for missing methods.
Anemone::__callStatic()
Proxy for missing static methods.
Anemone::__construct()
The constructor.
Anemone::__destruct()
The desctructor.
Anemone::__get()
Proxy for missing properties.
Anemone::__invoke()
Proxy for the current object, called as a function.
Anemone::__serialize()
Provides data to be serialized.
Anemone::__toString()
Proxy for the current object, casted as a string.
Anemone::__unserialize()
Converts the serialized data back to its object.
Anemone::all()
Checks if all items in the data pass the test.
Anemone::any()
Checks if at least one item in the data passes the test.
Anemone::chunk()
Splits the data into chunks.
Anemone::count()
Counts the amount of data.
Anemone::find()
Returns the first item in the data that passes the test.
Anemone::first()
Returns the first item in the data.
Anemone::from()
Object instantiator.
Anemone::get()
Gets value recursively.
Anemone::getIterator()
The external iterator receiver.
Anemone::has()
Checks for the existence of a key recursively.
Anemone::index()
Gets item position index in the data by key.
Anemone::is()
Filters the data so that only items that pass the test are left.
Anemone::join()
Joins the data into a string.
Anemone::jsonSerialize()
Returns the data to be serialized as JSON.
Anemone::key()
Gets item key in data by position index.
Anemone::last()
Returns the last item in the data.
Anemone::let()
Deletes value recursively.
Anemone::map()
Creates a new data set from the current data.
Anemone::mitose()
Creates a new instance without reference it to a variable.
Anemone::not()
Filters the data so that only items that do not pass the test are left.
Anemone::offsetExists()
Checks if an item with a certain key/index exists in the data.
Anemone::offsetGet()
Gets an item in the data using its key/index.
Anemone::offsetSet()
Sets a value to the specified key/index in the data.
Anemone::offsetUnset()
Deletes an item at the specified key/index in the data.
Anemone::pluck()
Returns a new data set contains values from the key on every item.
Anemone::reverse()
Reverses the order of the data.
Anemone::set()
Sets value recursively.
Anemone::shake()
Shakes the order of the data.
Anemone::sort()
Sorts the data.