variableToString() public static method

Returns a compact textual representation of a PHP variable.
public static variableToString ( mixed $variable ) : string
$variable mixed
return string
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);
 }
Exemplo n.º 2
0
 /**
  * Returns a the contents of a graphviz .dot file.
  *
  * @return boolean
  * @ignore
  */
 public function __toString()
 {
     $dot = 'digraph ' . $this->workflowName . " {\n";
     foreach ($this->nodes as $key => $data) {
         $dot .= sprintf("node%s [label=\"%s\", color=\"%s\"]\n", $key, $data['label'], $data['color']);
     }
     $dot .= "\n";
     foreach ($this->edges as $fromNode => $toNodes) {
         foreach ($toNodes as $toNode) {
             $dot .= sprintf("node%s -> node%s%s\n", $fromNode, $toNode[0], $toNode[1]);
         }
     }
     if (!empty($this->options['workflowVariables'])) {
         $dot .= 'variables [shape=none, label=<<table>';
         foreach ($this->options['workflowVariables'] as $name => $value) {
             $dot .= sprintf('<tr><td>%s</td><td>%s</td></tr>', $name, htmlspecialchars(ezcWorkflowUtil::variableToString($value)));
         }
         $dot .= "</table>>]\n";
     }
     return $dot . "}\n";
 }
Exemplo n.º 3
0
Arquivo: set.php Projeto: bmdevel/ezc
 /**
  * Returns a textual representation of this node.
  *
  * @return string
  * @ignore
  */
 public function __toString()
 {
     $buffer = array();
     foreach ($this->configuration as $variable => $value) {
         $buffer[] = $variable . ' = ' . ezcWorkflowUtil::variableToString($value);
     }
     return implode(', ', $buffer);
 }