Overview

Namespaces

  • Deimos
    • Flow
      • Extension
        • TBlock
        • TFor
        • TForeach
        • TIF
        • TLiteral
        • TPHP
        • TSimple
        • TTry
        • TWhile
      • Traits
  • PHP

Classes

  • Deimos\Flow\Block
  • Deimos\Flow\Configure
  • Deimos\Flow\DefaultConfig
  • Deimos\Flow\DefaultContainer
  • Deimos\Flow\Extension\TBlock\TBlockStart
  • Deimos\Flow\Extension\TBlock\TEndBlock
  • Deimos\Flow\Extension\TFor\TEndFor
  • Deimos\Flow\Extension\TFor\TFor
  • Deimos\Flow\Extension\TForeach\TElseForeach
  • Deimos\Flow\Extension\TForeach\TEndForeach
  • Deimos\Flow\Extension\TForeach\TForeach
  • Deimos\Flow\Extension\TIF\TELSE
  • Deimos\Flow\Extension\TIF\TELSEIF
  • Deimos\Flow\Extension\TIF\TEndIF
  • Deimos\Flow\Extension\TIF\TIF
  • Deimos\Flow\Extension\TLiteral\TLiteral
  • Deimos\Flow\Extension\TPHP\TEndPHP
  • Deimos\Flow\Extension\TPHP\TPHP
  • Deimos\Flow\Extension\TSimple\TAssign
  • Deimos\Flow\Extension\TSimple\TBreak
  • Deimos\Flow\Extension\TSimple\TContinue
  • Deimos\Flow\Extension\TSimple\TExtends
  • Deimos\Flow\Extension\TSimple\TInclude
  • Deimos\Flow\Extension\TSimple\TPartial
  • Deimos\Flow\Extension\TSimple\TVariable
  • Deimos\Flow\Extension\TTry\TCatch
  • Deimos\Flow\Extension\TTry\TEndTry
  • Deimos\Flow\Extension\TTry\TFinally
  • Deimos\Flow\Extension\TTry\TTry
  • Deimos\Flow\Extension\TWhile\TEndWhile
  • Deimos\Flow\Extension\TWhile\TWhile
  • Deimos\Flow\Flow
  • Deimos\Flow\FlowForeach
  • Deimos\Flow\FlowFunction
  • Deimos\Flow\ForeachState
  • Deimos\Flow\Lexer
  • Deimos\Flow\LexerConst
  • Deimos\Flow\Tokenizer

Interfaces

  • Throwable

Traits

  • Deimos\Flow\Traits\Block
  • Deimos\Flow\Traits\FileSystem
  • Deimos\Flow\Traits\Tokenizer

Exceptions

  • BadFunctionCallException
  • Exception
  • InvalidArgumentException
  • LogicException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: 
 3: namespace Deimos\Flow;
 4: 
 5: abstract class FlowFunction
 6: {
 7: 
 8:     const REGEXP_CALLBACK = '[\w"\[\]\(\)\$-\>]+';
 9:     const REGEXP_VARIABLE = '\$[\w"\'\[\]\(\)\$-\>]+';
10: 
11:     /**
12:      * @var array
13:      */
14:     public $data;
15: 
16:     /**
17:      * @var Flow
18:      */
19:     public $flow;
20: 
21:     /**
22:      * @var Configure
23:      */
24:     public $configure;
25: 
26:     /**
27:      * FlowFunction constructor.
28:      *
29:      * @param Flow      $flow
30:      * @param Configure $configure
31:      * @param array     $data
32:      */
33:     public function __construct(Flow $flow, Configure $configure, array $data)
34:     {
35:         $this->flow      = $flow;
36:         $this->configure = $configure;
37:         $this->data      = $data;
38:     }
39: 
40:     /**
41:      * @param $variable
42:      *
43:      * @return string
44:      */
45:     protected function variable($variable)
46:     {
47:         $variable = preg_replace('~(\$)(.*)\.([\w-_]+)~', '$1$2[\'$3\']', $variable);
48: 
49:         return trim($variable, '"\' ');
50:     }
51: 
52:     /**
53:      * @return int
54:      */
55:     public function random()
56:     {
57:         return $this->flow->random();
58:     }
59: 
60:     abstract public function view();
61: 
62: }
API documentation generated by ApiGen