Since: 1.0
Author: Bernhard Schussek (bschussek@gmail.com)
コード例 #1
0
ファイル: Same.php プロジェクト: webmozart/expression
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return '===' . StringUtil::formatValue($this->comparedValue);
 }
コード例 #2
0
ファイル: Contains.php プロジェクト: webmozart/expression
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return 'contains(' . StringUtil::formatValue($this->comparedValue) . ')';
 }
コード例 #3
0
ファイル: Method.php プロジェクト: webmozart/expression
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     $exprString = $this->expr->toString();
     $argsString = implode(', ', StringUtil::formatValues($this->arguments));
     if ($this->expr instanceof AndX || $this->expr instanceof OrX) {
         return $this->methodName . '(' . $argsString . '){' . $exprString . '}';
     }
     // Append "functions" with "."
     if (isset($exprString[0]) && ctype_alpha($exprString[0])) {
         return $this->methodName . '(' . $argsString . ').' . $exprString;
     }
     return $this->methodName . '(' . $argsString . ')' . $exprString;
 }
コード例 #4
0
ファイル: StartsWith.php プロジェクト: webmozart/expression
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return 'startsWith(' . StringUtil::formatValue($this->acceptedPrefix) . ')';
 }
コード例 #5
0
ファイル: EndsWith.php プロジェクト: webmozart/expression
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return 'endsWith(' . StringUtil::formatValue($this->acceptedSuffix) . ')';
 }
コード例 #6
0
ファイル: Matches.php プロジェクト: webmozart/expression
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return 'matches(' . StringUtil::formatValue($this->regExp) . ')';
 }
コード例 #7
0
ファイル: KeyExists.php プロジェクト: webmozart/expression
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     return 'keyExists(' . StringUtil::formatValue($this->key) . ')';
 }
コード例 #8
0
ファイル: In.php プロジェクト: webmozart/expression
 /**
  * {@inheritdoc}
  */
 public function toString()
 {
     $values = array_map(function ($value) {
         return StringUtil::formatValue($value);
     }, $this->acceptedValues);
     return 'in(' . implode(', ', $values) . ')';
 }