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: class DefaultConfig
 6: {
 7: 
 8:     /**
 9:      * @var array
10:      */
11:     protected $configStorage = [
12:         'substr'   => 'mb_substr',
13:         'strlen'   => 'mb_strlen',
14:         'count'    => 'count',
15:         'var_dump' => 'var_dump',
16:         'date'     => 'date',
17:     ];
18: 
19:     /**
20:      * DefaultConfig constructor.
21:      */
22:     public function __construct()
23:     {
24:         $this->registerCallback('length', function ($storage)
25:         {
26:             if (is_string($storage))
27:             {
28:                 return mb_strlen($storage);
29:             }
30: 
31:             if ($storage instanceof \ArrayObject)
32:             {
33:                 return $storage->count();
34:             }
35: 
36:             return count($storage);
37:         });
38: 
39:         $this->registerCallback('escape', function ($string)
40:         {
41:             return htmlentities($string, ENT_QUOTES | ENT_IGNORE, 'UTF-8');
42:         });
43:     }
44: 
45:     /**
46:      * @return array
47:      */
48:     public function configStorage()
49:     {
50:         return $this->configStorage;
51:     }
52: 
53:     /**
54:      * @param $name
55:      * @param $callable
56:      */
57:     public function registerCallback($name, $callable)
58:     {
59:         $this->configStorage[$name] = $callable;
60:     }
61: 
62: }
API documentation generated by ApiGen