675.1. Zend\Validator\File\WordCount
Validator for counting all words in a file
675.1.1. Methods
675.1.1.1. __construct
-
__construct()
Sets validator options
Min limits the word count, when used with max=null it is the maximum word count
It also accepts an array with the keys ‘min’ and ‘max’
If $options is a integer, it will be used as maximum word count
As Array is accepts the following keys:
‘min’: Minimum word count
‘max’: Maximum word count
Parameters: | integer|array|Traversable – Options for the adapter |
675.1.1.2. getMin
-
getMin()
Returns the minimum word count
675.1.1.3. setMin
-
setMin()
Sets the minimum word count
Parameters: | integer|array – The minimum word count |
Return type: | WordCount Provides a fluent interface |
Throws : | ExceptionInvalidArgumentException When min is greater than max |
675.1.1.4. getMax
-
getMax()
Returns the maximum word count
675.1.1.5. setMax
-
setMax()
Sets the maximum file count
Parameters: | integer|array – The maximum word count |
Return type: | WordCount Provides a fluent interface |
Throws : | ExceptionInvalidArgumentException When max is smaller than min |
675.1.1.6. isValid
-
isValid()
Returns true if and only if the counted words are at least min and
not bigger than max (when max is not null).
Parameters: | string – Filename to check for word count |
Return type: | bool |
675.1.2. Constants
675.1.2.1. TOO_MUCH
@const string Error constants
675.1.2.2. TOO_LESS
675.1.2.3. NOT_FOUND