Exemple #1
0
 /**
  * Checks the keyframes selector value.
  *
  * @param string $value
  * @return bool
  */
 public function checkValue(&$value)
 {
     if (parent::checkValue($value) === true) {
         if (!preg_match('/^(?:from|to|(?:\\d{1,2}|100)%)$/D', $value)) {
             $this->setIsValid(false);
             $this->addValidationError("Invalid value '{$value}' for the keyframe selector.");
             return false;
         }
         return true;
     }
     return false;
 }
Exemple #2
0
 /**
  * Checks the selector value.
  *
  * @param string $value
  * @return bool
  */
 public function checkValue(&$value)
 {
     if (parent::checkValue($value) === true) {
         $value = trim($value);
         if (in_array($value, [self::SELECTOR_ALL, self::SELECTOR_FIRST, self::SELECTOR_LEFT, self::SELECTOR_RIGHT, self::SELECTOR_BLANK])) {
             return true;
         } else {
             throw new \InvalidArgumentException("Invalid value '" . $value . "' for argument 'value'.");
         }
     }
     return false;
 }
Exemple #3
0
 /**
  * @param string $value
  * @param StyleSheet|null $styleSheet
  */
 public function __construct($value, StyleSheet $styleSheet = null)
 {
     parent::__construct($value, $styleSheet);
 }