|
4 | 4 |
|
5 | 5 | use Symfony\Component\DependencyInjection\ContainerInterface; |
6 | 6 |
|
7 | | -class TicketGlobalExtension extends \Twig_Extension { |
8 | | - |
| 7 | +class TicketGlobalExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface |
| 8 | +{ |
9 | 9 | /** |
10 | | - * |
11 | | - * @access protected |
12 | | - * @var \Symfony\Component\DependencyInjection\ContainerInterface $container |
| 10 | + * @var \Symfony\Component\DependencyInjection\ContainerInterface |
13 | 11 | */ |
14 | 12 | protected $container; |
15 | 13 |
|
16 | 14 | /** |
17 | | - * |
18 | | - * @access public |
19 | 15 | * @param \Symfony\Component\DependencyInjection\ContainerInterface $container |
20 | 16 | */ |
21 | | - public function __construct(ContainerInterface $container) { |
| 17 | + public function __construct(ContainerInterface $container) |
| 18 | + { |
22 | 19 | $this->container = $container; |
23 | 20 | } |
24 | 21 |
|
25 | 22 | /** |
26 | | - * |
27 | | - * @access public |
28 | 23 | * @return array |
29 | 24 | */ |
30 | | - public function getGlobals() { |
31 | | - return array( |
32 | | - 'hackzilla_ticket' => array( |
33 | | - 'templates' => array( |
34 | | - 'index' => $this->container->getParameter('hackzilla_ticket.templates.index'), |
35 | | - 'new' => $this->container->getParameter('hackzilla_ticket.templates.new'), |
36 | | - 'show' => $this->container->getParameter('hackzilla_ticket.templates.show'), |
| 25 | + public function getGlobals() |
| 26 | + { |
| 27 | + return [ |
| 28 | + 'hackzilla_ticket' => [ |
| 29 | + 'templates' => [ |
| 30 | + 'index' => $this->container->getParameter('hackzilla_ticket.templates.index'), |
| 31 | + 'new' => $this->container->getParameter('hackzilla_ticket.templates.new'), |
| 32 | + 'show' => $this->container->getParameter('hackzilla_ticket.templates.show'), |
37 | 33 | 'show_attachment' => $this->container->getParameter('hackzilla_ticket.templates.show_attachment'), |
38 | | - 'prototype' => $this->container->getParameter('hackzilla_ticket.templates.prototype'), |
39 | | - 'macros' => $this->container->getParameter('hackzilla_ticket.templates.macros'), |
40 | | - ), |
41 | | - ) |
42 | | - ); |
| 34 | + 'prototype' => $this->container->getParameter('hackzilla_ticket.templates.prototype'), |
| 35 | + 'macros' => $this->container->getParameter('hackzilla_ticket.templates.macros'), |
| 36 | + ], |
| 37 | + ], |
| 38 | + ]; |
43 | 39 | } |
44 | 40 |
|
45 | 41 | /** |
46 | | - * |
47 | | - * @access public |
48 | 42 | * @return string |
49 | 43 | */ |
50 | | - public function getName() { |
| 44 | + public function getName() |
| 45 | + { |
51 | 46 | return 'ticketGlobal'; |
52 | 47 | } |
53 | | - |
54 | 48 | } |
0 commit comments