芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/avenida/vendor/respect/validation/library/Rules/AllOf.php
* * For the full copyright and license information, please view the "LICENSE.md" * file that was distributed with this source code. */ namespace Respect\Validation\Rules; class AllOf extends AbstractComposite { public function assert($input) { $exceptions = $this->validateRules($input); $numRules = count($this->rules); $numExceptions = count($exceptions); $summary = [ 'total' => $numRules, 'failed' => $numExceptions, 'passed' => $numRules - $numExceptions, ]; if (!empty($exceptions)) { throw $this->reportError($input, $summary)->setRelated($exceptions); } return true; } public function check($input) { foreach ($this->getRules() as $rule) { $rule->check($input); } return true; } public function validate($input) { foreach ($this->getRules() as $rule) { if (!$rule->validate($input)) { return false; } } return true; } }