You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Craig Manley edited this page Feb 17, 2016
·
3 revisions
Validate\Specs
A Specs object is simply a collection of Spec objects.
Specs objects behave as (associative) arrays since they implement the Countable, IteratorAggregate, and ArrayAccess interfaces.
Class name: Specs
Namespace: Validate
This class implements: Countable, IteratorAggregate, ArrayAccess
Methods
__construct
__construct(array $pairs)
The constructor takes an (associative) array of name => value pairs as argument.
Typically, values must be Spec objects.
For convenience sake, the following non-Spec type values are also allowed:
boolean - then these are converted into a Spec object with 'optional' => !$value
array - these are used as arguments to create a new Spec object
count
integer count()
Implements countable. Returns the number of Spec objects in the collection.