| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class RsExtension extends \Twig_Extension |
||
| 17 | { |
||
| 18 | /** @var MeuRSHelper */ |
||
| 19 | private $rsHelper; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * RsExtension constructor. |
||
| 23 | * @param MeuRSHelper $rsHelper |
||
| 24 | */ |
||
| 25 | 1 | public function __construct(MeuRSHelper $rsHelper) |
|
| 26 | { |
||
| 27 | 1 | $this->rsHelper = $rsHelper; |
|
| 28 | 1 | } |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @return array|\Twig_SimpleFilter[] |
||
| 32 | */ |
||
| 33 | 1 | public function getFilters() |
|
| 34 | { |
||
| 35 | return [ |
||
| 36 | 1 | new \Twig_SimpleFilter('personRS', [$this, 'getPersonRS']), |
|
| 37 | ]; |
||
| 38 | } |
||
| 39 | |||
| 40 | 1 | public function getPersonRS(PersonInterface $person) |
|
| 41 | { |
||
| 42 | 1 | return $this->rsHelper->getPersonMeuRS($person); |
|
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Returns the name of the extension. |
||
| 47 | * |
||
| 48 | * @return string The extension name |
||
| 49 | */ |
||
| 50 | 1 | public function getName() |
|
| 53 | } |
||
| 54 | } |
||
| 55 |