Webmozart\Expression\Util\StringUtil::formatValues PHP Method

formatValues() public static method

Formats a list of values as strings.
public static formatValues ( array $values ) : array
$values array The values.
return array The values as strings.
    public static function formatValues(array $values)
    {
        foreach ($values as $key => $value) {
            $values[$key] = self::formatValue($value);
        }
        return $values;
    }

Usage Example

コード例 #1
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;
 }