Definition at line 35 of file WordCount.php.
◆ _throw()
_throw |
( |
|
$file, |
|
|
|
$errorType |
|
) |
| |
|
protected |
Throws an error of the given type
- Parameters
-
string | $file | |
string | $errorType | |
- Returns
- false
Definition at line 92 of file WordCount.php.
95 $this->_value = $file[
'name'];
_error($messageKey, $value=null)
◆ isValid()
isValid |
( |
|
$value, |
|
|
|
$file = null |
|
) |
| |
Defined by Zend_Validate_Interface
Returns true if and only if the counted words are at least min and not bigger than max (when max is not null).
- Parameters
-
- Returns
- boolean
Definition at line 64 of file WordCount.php.
67 #require_once 'Zend/Loader.php'; 69 return $this->
_throw($file, self::NOT_FOUND);
73 $this->_count = str_word_count(
$content);
74 if (($this->_max !==
null) && ($this->_count > $this->_max)) {
75 return $this->
_throw($file, self::TOO_MUCH);
78 if (($this->_min !==
null) && ($this->_count < $this->_min)) {
79 return $this->
_throw($file, self::TOO_LESS);
_throw($file, $errorType)
static isReadable($filename)
◆ $_messageTemplates
Initial value:= array(
self::TOO_MUCH => "Too much words, maximum '%max%' are allowed but '%count%' were counted",
self::TOO_LESS => "Too less words, minimum '%min%' are expected but '%count%' were counted",
self::NOT_FOUND => "File '%value%' is not readable or does not exist",
)
Definition at line 48 of file WordCount.php.
◆ NOT_FOUND
const NOT_FOUND = 'fileWordCountNotFound' |
◆ TOO_LESS
const TOO_LESS = 'fileWordCountTooLess' |
◆ TOO_MUCH
const TOO_MUCH = 'fileWordCountTooMuch' |
#+ @const string Error constants
Definition at line 40 of file WordCount.php.
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Validate/File/WordCount.php