1 | <?php |
||
8 | class Settings |
||
9 | { |
||
10 | /** Optional Chart Rendering libraries */ |
||
11 | const CHART_RENDERER_JPGRAPH = 'JpGraph'; |
||
12 | |||
13 | private static $chartRenderers = [ |
||
14 | self::CHART_RENDERER_JPGRAPH, |
||
15 | ]; |
||
16 | |||
17 | /** |
||
18 | * Name of the external Library used for rendering charts |
||
19 | * e.g. |
||
20 | * jpgraph. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | private static $chartRendererName; |
||
25 | |||
26 | /** |
||
27 | * Directory Path to the external Library used for rendering charts. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | private static $chartRendererPath; |
||
32 | |||
33 | /** |
||
34 | * Default options for libxml loader. |
||
35 | * |
||
36 | * @var int |
||
37 | */ |
||
38 | private static $libXmlLoaderOptions = null; |
||
39 | |||
40 | /** |
||
41 | * The cache implementation to be used for cell collection. |
||
42 | * |
||
43 | * @var CacheInterface |
||
44 | */ |
||
45 | private static $cache; |
||
46 | |||
47 | /** |
||
48 | * Set the locale code to use for formula translations and any special formatting. |
||
49 | * |
||
50 | * @param string $locale The locale code to use (e.g. "fr" or "pt_br" or "en_uk") |
||
51 | * |
||
52 | * @return bool Success or failure |
||
53 | */ |
||
54 | public static function setLocale($locale) |
||
58 | |||
59 | /** |
||
60 | * Set details of the external library that PhpSpreadsheet should use for rendering charts. |
||
61 | * |
||
62 | * @param string $libraryName Internal reference name of the library |
||
63 | * e.g. \PhpOffice\PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH |
||
64 | * @param string $libraryBaseDir Directory path to the library's base folder |
||
65 | * |
||
66 | * @return bool Success or failure |
||
67 | */ |
||
68 | 3 | public static function setChartRenderer($libraryName, $libraryBaseDir) |
|
76 | |||
77 | /** |
||
78 | * Identify to PhpSpreadsheet the external library to use for rendering charts. |
||
79 | * |
||
80 | * @param string $libraryName Internal reference name of the library |
||
81 | * e.g. \PhpOffice\PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH |
||
82 | * |
||
83 | * @return bool Success or failure |
||
84 | */ |
||
85 | 3 | public static function setChartRendererName($libraryName) |
|
94 | |||
95 | /** |
||
96 | * Tell PhpSpreadsheet where to find the external library to use for rendering charts. |
||
97 | * |
||
98 | * @param string $libraryBaseDir Directory path to the library's base folder |
||
99 | * |
||
100 | * @return bool Success or failure |
||
101 | */ |
||
102 | 3 | public static function setChartRendererPath($libraryBaseDir) |
|
111 | |||
112 | /** |
||
113 | * Return the Chart Rendering Library that PhpSpreadsheet is currently configured to use (e.g. jpgraph). |
||
114 | * |
||
115 | * @return null|string Internal reference name of the Chart Rendering Library that PhpSpreadsheet is |
||
116 | * currently configured to use |
||
117 | * e.g. \PhpOffice\PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH |
||
118 | */ |
||
119 | public static function getChartRendererName() |
||
123 | |||
124 | /** |
||
125 | * Return the directory path to the Chart Rendering Library that PhpSpreadsheet is currently configured to use. |
||
126 | * |
||
127 | * @return null|string Directory Path to the Chart Rendering Library that PhpSpreadsheet is |
||
128 | * currently configured to use |
||
129 | */ |
||
130 | public static function getChartRendererPath() |
||
134 | |||
135 | /** |
||
136 | * Set default options for libxml loader. |
||
137 | * |
||
138 | * @param int $options Default options for libxml loader |
||
139 | */ |
||
140 | 16 | public static function setLibXmlLoaderOptions($options) |
|
147 | |||
148 | /** |
||
149 | * Get default options for libxml loader. |
||
150 | * Defaults to LIBXML_DTDLOAD | LIBXML_DTDATTR when not set explicitly. |
||
151 | * |
||
152 | * @return int Default options for libxml loader |
||
153 | */ |
||
154 | 28 | public static function getLibXmlLoaderOptions() |
|
164 | |||
165 | /** |
||
166 | * Sets the implementation of cache that should be used for cell collection. |
||
167 | * |
||
168 | * @param CacheInterface $cache |
||
169 | */ |
||
170 | public static function setCache(CacheInterface $cache) |
||
174 | |||
175 | /** |
||
176 | * Gets the implementation of cache that should be used for cell collection. |
||
177 | * |
||
178 | * @return CacheInterface |
||
179 | */ |
||
180 | 149 | public static function getCache() |
|
188 | } |
||
189 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.