Beispiel #1
0
 /**
  * Returns the parameters that may be used in a validation message.
  *
  * @return array
  */
 protected function getMessageParameters()
 {
     $quote = function ($value) {
         return '"' . $value . '"';
     };
     return array_merge(parent::getMessageParameters(), ['values' => implode(', ', array_map($quote, $this->array))]);
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 protected function getMessageParameters()
 {
     return array_merge(parent::getMessageParameters(), ['allowEmpty' => $this->allowEmpty, 'callback' => $this->getCallbackAsString($this->allowEmptyCallback)]);
 }
Beispiel #3
0
 /**
  * Validates the value according to this rule, and returns the result as a bool.
  *
  * @param string $key
  * @param Container $input
  * @return bool
  */
 public function isValid($key, Container $input)
 {
     $this->values = $input->getArrayCopy();
     return parent::isValid($key, $input);
 }
Beispiel #4
0
 /**
  * Returns the parameters that may be used in a validation message.
  *
  * @return array
  */
 protected function getMessageParameters()
 {
     return array_merge(parent::getMessageParameters(), ['length' => $this->length]);
 }
Beispiel #5
0
 /**
  * Returns the parameters that may be used in a validation message.
  *
  * @return array
  */
 protected function getMessageParameters()
 {
     return array_merge(parent::getMessageParameters(), ['max' => $this->max]);
 }
Beispiel #6
0
 /**
  * @return array
  */
 protected function getMessageParameters()
 {
     return array_merge(parent::getMessageParameters(), ['schemes' => implode(', ', $this->schemes)]);
 }
Beispiel #7
0
 /**
  * {@inheritdoc}
  */
 protected function getMessageParameters()
 {
     return array_merge(parent::getMessageParameters(), ['required' => $this->required, 'callback' => $this->getCallbackAsString($this->requiredCallback)]);
 }
Beispiel #8
0
 /**
  * Returns the parameters that may be used in a validation message.
  *
  * @return array
  */
 protected function getMessageParameters()
 {
     return array_merge(parent::getMessageParameters(), ['testvalue' => $this->value]);
 }