1 | <?php |
||
18 | class TwigAssetic implements PluginInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var AssetFactory |
||
22 | */ |
||
23 | protected $factory; |
||
24 | |||
25 | /** |
||
26 | * @var AssetWriter |
||
27 | */ |
||
28 | protected $writer; |
||
29 | |||
30 | /** |
||
31 | * Class constructor |
||
32 | * |
||
33 | * @param AssetFactory $factory |
||
34 | * @param AssetWriter $writer |
||
35 | */ |
||
36 | 4 | public function __construct(AssetFactory $factory, AssetWriter $writer) |
|
41 | |||
42 | /** |
||
43 | * Check that the view is a twig view |
||
44 | * |
||
45 | * @param ViewInterface $view |
||
46 | * @throws \InvalidArgumentException |
||
47 | */ |
||
48 | 4 | protected function assertView(ViewInterface $view) |
|
54 | |||
55 | |||
56 | /** |
||
57 | * Create an assetic extension for Twig. |
||
58 | * @codeCoverageIgnore |
||
59 | * |
||
60 | * @return AsseticExtension |
||
61 | */ |
||
62 | protected function createExtension() |
||
66 | |||
67 | /** |
||
68 | * Create an assetic formula loader. |
||
69 | * @codeCoverageIgnore |
||
70 | * |
||
71 | * @param \Twig_Environment $twig |
||
72 | * @return TwigFormulaLoader |
||
73 | */ |
||
74 | protected function createFormulaLoader($twig) |
||
78 | |||
79 | /** |
||
80 | * Create an assetic asset manager. |
||
81 | * @codeCoverageIgnore |
||
82 | * |
||
83 | * @param TwigFormulaLoader $loader |
||
84 | * @return LazyAssetManager |
||
85 | */ |
||
86 | protected function createAssetManager(TwigFormulaLoader $loader) |
||
90 | |||
91 | /** |
||
92 | * Create an assetic twig resource. |
||
93 | * @codeCoverageIgnore |
||
94 | * |
||
95 | * @param \Twig_Environment $twig |
||
96 | * @param string $template |
||
97 | * @return TwigResource |
||
98 | */ |
||
99 | protected function createResource($twig, $template) |
||
103 | |||
104 | |||
105 | /** |
||
106 | * Called when the plugin is added to the view. |
||
107 | * |
||
108 | * @param ViewInterface $view |
||
109 | */ |
||
110 | 3 | public function onAdd(ViewInterface $view) |
|
116 | |||
117 | /** |
||
118 | * Called when view renders a template. |
||
119 | * |
||
120 | * @param ViewInterface $view |
||
121 | * @param string $template Template filename |
||
122 | * @param array $context |
||
123 | */ |
||
124 | 1 | public function onRender(ViewInterface $view, $template, array $context) |
|
140 | } |
||
141 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.