\VersatileCollections\ScalarsCollection
is a Collection class that only accepts
items that are scalars (i.e. booleans,
floats,
integers
or strings ).
It accepts any mix of scalars, e.g. ints, booleans, floats and strings can all
be present in an instance of this type of collection.
Example Usage:
$collection = new \VersatileCollections\ScalarsCollection(
1, // integer
2.5, // float
true, // boolean
false, // boolean
'Hello World!' // string
);
// OR
$collection = \VersatileCollections\ScalarsCollection::makeNew([
1, // integer
2.5, // float
true, // boolean
false, // boolean
'Hello World!' // string
]);
// OR
$collection = new \VersatileCollections\ScalarsCollection();
$collection[] = 1;
$collection[] = 2.5;
$collection[] = true;
$collection[] = false;
$collection[] = 'Hello World!';