formatValue() public static method

Formats a value as string.
public static formatValue ( mixed $value ) : string
$value mixed The value.
return string The value as string.
Example #1
0
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return 'contains(' . StringUtil::formatValue($this->comparedValue) . ')';
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return '===' . StringUtil::formatValue($this->comparedValue);
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return 'startsWith(' . StringUtil::formatValue($this->acceptedPrefix) . ')';
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return 'endsWith(' . StringUtil::formatValue($this->acceptedSuffix) . ')';
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return 'matches(' . StringUtil::formatValue($this->regExp) . ')';
 }
Example #6
0
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return 'keyExists(' . StringUtil::formatValue($this->key) . ')';
 }
Example #7
0
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     $values = array_map(function ($value) {
         return StringUtil::formatValue($value);
     }, $this->acceptedValues);
     return 'in(' . implode(', ', $values) . ')';
 }