| Total Complexity | 8 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class UtilitaExtension extends \Twig_Extension |
||
| 8 | { |
||
| 9 | private $container; |
||
| 10 | |||
| 11 | 26 | public function __construct($container) |
|
| 12 | { |
||
| 13 | 26 | $this->container = $container; |
|
| 14 | 26 | } |
|
| 15 | |||
| 16 | /** |
||
| 17 | * {@inheritdoc} |
||
| 18 | */ |
||
| 19 | 1 | public function getFunctions() |
|
| 20 | { |
||
| 21 | return array( |
||
| 22 | 1 | new \Twig_SimpleFunction('json_decode', array($this, 'jsonDecode', 'is_safe' => array('html'))), |
|
| 23 | 1 | new \Twig_SimpleFunction('parameter', array($this, 'getParameter', 'is_safe' => array('html'))), |
|
| 24 | ); |
||
| 25 | } |
||
| 26 | |||
| 27 | 1 | public function getFilters() |
|
| 28 | { |
||
| 29 | return array( |
||
| 30 | 1 | new \Twig_SimpleFilter('getparametrotabella', array($this, 'getParametroTabella')), |
|
| 31 | 1 | new \Twig_SimpleFilter('larghezzacolonna', array($this, 'getLarghezzacolonna')), |
|
| 32 | ); |
||
| 33 | } |
||
| 34 | |||
| 35 | 7 | public function jsonDecode($string) |
|
| 38 | } |
||
| 39 | |||
| 40 | 12 | public function getParameter($parameter) |
|
| 43 | } |
||
| 44 | |||
| 45 | 11 | public function getParametroTabella($parametro) |
|
| 48 | } |
||
| 49 | |||
| 50 | 6 | public function getLarghezzacolonna($larghezza) |
|
| 58 | } |
||
| 59 | } |
||
| 60 |