public static function __callStatic($ruleName, $arguments) { if ('allOf' === $ruleName) { return static::buildRule($ruleName, $arguments); } $validator = new static(); return $validator->__call($ruleName, $arguments); }
private function getRule($input) { if (!isset($input[$this->comparedKey])) { throw $this->reportError($this->comparedKey); } if (!isset($input[$this->baseKey])) { throw $this->reportError($this->baseKey); } try { $rule = Validator::__callStatic($this->ruleName, [$input[$this->baseKey]]); $rule->setName($this->comparedKey); } catch (ComponentException $exception) { throw $this->reportError($input, ['component' => true]); } return $rule; }