| Total Complexity | 5 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class CodeExtension extends \Twig_Extension |
||
| 8 | { |
||
| 9 | private $reader; |
||
| 10 | |||
| 11 | public function __construct(CodeReader $reader) |
||
| 12 | { |
||
| 13 | $this->reader = $reader; |
||
| 14 | } |
||
| 15 | |||
| 16 | public function getName() |
||
| 17 | { |
||
| 18 | return 'app_code'; |
||
| 19 | } |
||
| 20 | |||
| 21 | public function getFunctions() |
||
| 22 | { |
||
| 23 | return [ |
||
| 24 | new \Twig_SimpleFunction('app_method_source', [$this, 'getMethodSource']), |
||
| 25 | new \Twig_SimpleFunction('app_class_source', [$this, 'getClassSource']), |
||
| 26 | ]; |
||
| 27 | } |
||
| 28 | |||
| 29 | public function getMethodSource($spec, $bound = CodeReader::BOUND_FORM_BUILDER) |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getClassSource($class) |
||
| 37 | } |
||
| 38 | } |
||
| 39 |