ezcWorkflowUtil::variableToString PHP Method

variableToString() public static method

Returns a compact textual representation of a PHP variable.
public static variableToString ( mixed $variable ) : string
$variable mixed
return string
    public static function variableToString($variable)
    {
        if ($variable === null) {
            return '<null>';
        }
        if ($variable === true) {
            return '<true>';
        }
        if ($variable === false) {
            return '<false>';
        }
        if (is_array($variable)) {
            return '<array>';
        }
        if (is_object($variable)) {
            return '<' . get_class($variable) . '>';
        }
        return $variable;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Called after a variable has been set.
  *
  * @param ezcWorkflowExecution $execution
  * @param string               $variableName
  * @param mixed                $value
  */
 public function afterVariableSet(ezcWorkflowExecution $execution, $variableName, $value)
 {
     $this->notifyListeners(sprintf('Set variable "%s" to "%s" for execution #%d of workflow "%s" (version %d).', $variableName, ezcWorkflowUtil::variableToString($value), $execution->getId(), $execution->workflow->name, $execution->workflow->version), ezcWorkflowExecutionListener::DEBUG);
 }
All Usage Examples Of ezcWorkflowUtil::variableToString