Skip to content

Commit

Permalink
Improve wording in doc blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory authored and ravage84 committed Oct 31, 2018
1 parent c2a5f04 commit 6a35b92
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/Validation/Validator.php
Expand Up @@ -40,7 +40,7 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
/**
* A flag for allowEmptyByFlags()
*
* When an empty string given, it will be recognized as empty.
* When an empty string is given, it will be recognized as empty.
*
* @var int
*/
Expand All @@ -49,7 +49,7 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
/**
* A flag for allowEmptyByFlags()
*
* When an empty array given, it will be recognized as empty.
* When an empty array is given, it will be recognized as empty.
*
* @var int
*/
Expand All @@ -58,8 +58,8 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
/**
* A flag for allowEmptyByFlags()
*
* When an array given, if it has the four keys - 'name', 'type', 'tmp_name' and 'error' at
* least, and the value of 'error' equals to UPLOAD_ERR_NO_FILE, it will be recognized as
* When an array is given, if it has at least the `name`, `type`, `tmp_name` and `error` keys,
* and the value of `error` is equal to `UPLOAD_ERR_NO_FILE`, the value will be recognized as
* empty.
*
* @var int
Expand All @@ -69,8 +69,8 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
/**
* A flag for allowEmptyByFlags()
*
* When an array given, if it has the 'year' key at least, and contains only empty strings
* and nulls, it will be recognized as empty.
* When an array is given, if it contains the `year` key, and only empty strings
* or null values, it will be recognized as empty.
*
* @var int
*/
Expand All @@ -79,8 +79,8 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
/**
* A flag for allowEmptyByFlags()
*
* When an array given, if it has the 'hour' key at least, and contains only empty strings
* and nulls, it will be recognized as empty.
* When an array is given, if it contains the `hour` key, and only empty strings
* or null values, it will be recognized as empty.
*
* @var int
*/
Expand Down Expand Up @@ -699,12 +699,13 @@ public function allowEmpty($field, $when = true, $message = null)
}

/**
* Allows a field to be empty. You can also pass array.
* Indicate that a field can be empty.
*
* Using an array will let you provide the following keys:
*
* - `flags` individual flags for field
* - `when` individual when condition for field
* - 'message' individual message for field
* - `message` individual message for field
*
* You can also set flags, when and message for all passed fields, the individual
* setting takes precedence over group settings.
Expand Down Expand Up @@ -781,7 +782,7 @@ public function allowEmptyByFlags($field, $flags, $when = true, $message = null)
$settingsDefault = [
'flags' => $flags,
'when' => $when,
'message' => $message
'message' => $message,
];

if (!is_array($field)) {
Expand Down

0 comments on commit 6a35b92

Please sign in to comment.