src/Callbacks/DatetimeValidatorCallback.php 1 location
|
@@ 110-126 (lines=17) @@
|
| 107 |
|
* |
| 108 |
|
* @return mixed The modified value |
| 109 |
|
*/ |
| 110 |
|
public function handle($attributeCode = null, $attributeValue = null) |
| 111 |
|
{ |
| 112 |
|
|
| 113 |
|
// query whether or not we've found a value and it is a valid date |
| 114 |
|
if ($this->isNullable($attributeValue) || $this->isDate($attributeValue)) { |
| 115 |
|
return; |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
// throw an exception if the value is NOT in the array |
| 119 |
|
throw new \InvalidArgumentException( |
| 120 |
|
sprintf( |
| 121 |
|
'Found invalid date "%s" for column "%s"', |
| 122 |
|
$attributeValue, |
| 123 |
|
$attributeCode |
| 124 |
|
) |
| 125 |
|
); |
| 126 |
|
} |
| 127 |
|
} |
| 128 |
|
|
src/Callbacks/NumberValidatorCallback.php 1 location
|
@@ 110-126 (lines=17) @@
|
| 107 |
|
* |
| 108 |
|
* @return mixed The modified value |
| 109 |
|
*/ |
| 110 |
|
public function handle($attributeCode = null, $attributeValue = null) |
| 111 |
|
{ |
| 112 |
|
|
| 113 |
|
// query whether or not we've found a value and it is a valid number |
| 114 |
|
if ($this->isNullable($attributeValue) || $this->isNumber($attributeValue)) { |
| 115 |
|
return; |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
// throw an exception if the value is NOT in the array |
| 119 |
|
throw new \InvalidArgumentException( |
| 120 |
|
sprintf( |
| 121 |
|
'Found invalid number "%s" for column "%s"', |
| 122 |
|
$attributeValue, |
| 123 |
|
$attributeCode |
| 124 |
|
) |
| 125 |
|
); |
| 126 |
|
} |
| 127 |
|
} |
| 128 |
|
|