1 | <?php |
||
28 | final class HighchartsTwigExtension extends AbstractExtension { |
||
29 | |||
30 | /** |
||
31 | * Service name. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | const SERVICE_NAME = "webeweb.bundle.highchartsbundle.twig.extension.highcharts"; |
||
36 | |||
37 | /** |
||
38 | * Directory. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | private $directory; |
||
43 | |||
44 | /** |
||
45 | * Environment. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | private $environment; |
||
50 | |||
51 | /** |
||
52 | * Wrapper. |
||
53 | * |
||
54 | * @var HightchartsWrapper |
||
55 | */ |
||
56 | private $wrapper; |
||
57 | |||
58 | /** |
||
59 | * Constructor. |
||
60 | * |
||
61 | * @param string $directory The directory. |
||
62 | * @param string $environment The environment. |
||
63 | */ |
||
64 | public function __construct($directory, $environment) { |
||
69 | |||
70 | /** |
||
71 | * Get the Twig functions. |
||
72 | * |
||
73 | * @return TwigFunction[] Returns the Twig functions. |
||
74 | */ |
||
75 | public function getFunctions() { |
||
82 | |||
83 | /** |
||
84 | * Get the resources directory. |
||
85 | * |
||
86 | * @return string Returns the resources directory. |
||
87 | */ |
||
88 | private function getResourcesDirectory() { |
||
91 | |||
92 | /** |
||
93 | * Displays an Highcharts.chart(). |
||
94 | * |
||
95 | * @param string $selector The selector. |
||
96 | * @param HighchartsChart $chart The chart. |
||
97 | * @return string Returns the Highcharts.chart(). |
||
98 | */ |
||
99 | public function highchartsChartFunction($selector, HighchartsChart $chart) { |
||
116 | |||
117 | /** |
||
118 | * Displays an Highcharts script. |
||
119 | * |
||
120 | * @param string $script The scriptname. |
||
121 | * @param string $subdirectory The sub directory. |
||
122 | * @return string Returns the Highcharts script. |
||
123 | * @throws FileNotFoundException Throws a file not found exception if the script is not found. |
||
124 | */ |
||
125 | public function highchartsScriptFunction($script, $subdirectory = "code") { |
||
139 | |||
140 | /** |
||
141 | * Displays an Highcharts.setOptions() |
||
142 | * |
||
143 | * @param HighchartsOptions $options The options. |
||
144 | * @return string Returns the Highcharts.setOptions(). |
||
145 | */ |
||
146 | public function highchartsSetOptionsFunction(HighchartsOptions $options) { |
||
163 | |||
164 | /** |
||
165 | * Determines if the environement is dev. |
||
166 | * |
||
167 | * @return boolean Returns true in case of success, false otherwise. |
||
168 | */ |
||
169 | private function isDevEnvironment() { |
||
172 | |||
173 | } |
||
174 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..