protected function constructException($entityNewValue) { $error = new RuleExecutionException(sprintf('Property is required: but given: %s', var_export($entityNewValue, true))); $error->setHumanFriendlyMessage('Is required field'); return $error; }
/** * * @param null|mixed $entityNewValue * @param null|mixed $entityOldValue * * @return RuleExecutionException */ protected function constructException($entityNewValue = null, $entityOldValue = null) { $error = new RuleExecutionException(sprintf('Property is readOnly. But value has been modified:, Old Value: %s, New value: %s', var_export($entityOldValue, true), var_export($entityNewValue, true))); $error->setHumanFriendlyMessage('Is read only field'); return $error; }
/** * Создать Exception, описывающий ошибку проверки * * @return mixed */ protected function constructException() { $e = new RuleExecutionException('You never been saw this exception. This rule always true'); $e->setHumanFriendlyMessage('You never been saw this exception. This rule always true'); return $e; }
/** * Создать Exception, описывающий ошибку проверки * * @return RuleExecutionException */ protected function constructException() { $e = new RuleExecutionException('This rule is always return false'); $e->setHumanFriendlyMessage('This rule is always return false'); return $e; }
/** * Создать Exception, описывающий ошибку проверки * * @param null $value * * @return mixed */ protected function constructException($value = null) { $e = new RuleExecutionException(sprintf('Value must be greater than 0. Given: %s', $value)); $e->setHumanFriendlyMessage('Must be greater than 0'); return $e; }