| Total Complexity | 8 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 70% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class UtilitaExtension extends AbstractExtension |
||
| 11 | { |
||
| 12 | private $container; |
||
| 13 | |||
| 14 | 25 | public function __construct($container) |
|
| 17 | 25 | } |
|
| 18 | |||
| 19 | /** |
||
| 20 | * {@inheritdoc} |
||
| 21 | */ |
||
| 22 | public function getFunctions() |
||
| 23 | { |
||
| 24 | return array( |
||
| 25 | new TwigFunction('json_decode', array($this, 'jsonDecode', 'is_safe' => array('html'))), |
||
| 26 | new TwigFunction('parameter', array($this, 'getParameter', 'is_safe' => array('html'))), |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function getFilters() |
||
| 31 | { |
||
| 32 | return array( |
||
| 33 | new TwigFilter('getparametrotabella', array($this, 'getParametroTabella')), |
||
| 34 | new TwigFilter('larghezzacolonna', array($this, 'getLarghezzacolonna')), |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | |||
| 38 | 7 | public function jsonDecode($string) |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | public function getParameter($parameter) |
|
| 44 | { |
||
| 45 | 1 | return $this->container->getParameter($parameter); |
|
| 46 | } |
||
| 47 | |||
| 48 | 10 | public function getParametroTabella($parametro) |
|
| 49 | { |
||
| 50 | 10 | return ParametriTabella::getParameter($parametro); |
|
| 51 | } |
||
| 52 | |||
| 53 | 7 | public function getLarghezzacolonna($larghezza) |
|
| 61 | } |
||
| 62 | } |
||
| 63 |