@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | </span> |
43 | 43 | |
44 | 44 | <?php foreach ($collectors as $c) : ?> |
45 | - <?php if (! $c['isEmpty'] && ($c['hasTabContent'] || $c['hasLabel'])) : ?> |
|
45 | + <?php if (!$c['isEmpty'] && ($c['hasTabContent'] || $c['hasLabel'])) : ?> |
|
46 | 46 | <span class="blitzphp-label"> |
47 | 47 | <a href="javascript: void(0)" data-tab="blitzphp-<?= $c['titleSafe'] ?>"> |
48 | 48 | <img src="<?= $c['icon'] ?>"> |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | <!-- Collector-provided Tabs --> |
104 | 104 | <?php foreach ($collectors as $c) : ?> |
105 | - <?php if (! $c['isEmpty']) : ?> |
|
105 | + <?php if (!$c['isEmpty']) : ?> |
|
106 | 106 | <?php if ($c['hasTabContent']) : ?> |
107 | 107 | <div id="blitzphp-<?= $c['titleSafe'] ?>" class="tab"> |
108 | 108 | <h2><?= $c['title'] ?> <span><?= $c['titleDetails'] ?></span></h2> |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | </a> |
150 | 150 | |
151 | 151 | <?php if (isset($vars['session'])) : ?> |
152 | - <?php if (! empty($vars['session'])) : ?> |
|
152 | + <?php if (!empty($vars['session'])) : ?> |
|
153 | 153 | <table id="session_table"> |
154 | 154 | <tbody> |
155 | 155 | <?php foreach ($vars['session'] as $key => $value) : ?> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $this->config = $config ?? (object) config('toolbar'); |
67 | 67 | |
68 | 68 | foreach ($this->config->collectors as $collector) { |
69 | - if (! class_exists($collector)) { |
|
69 | + if (!class_exists($collector)) { |
|
70 | 70 | logger()->critical( |
71 | 71 | 'Toolbar collector does not exist (' . $collector . ').' |
72 | 72 | . ' Please check $collectors in the app/Config/toolbar.php file.' |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $data['vars']['varData'][esc($heading)] = $varData; |
133 | 133 | } |
134 | 134 | |
135 | - if (! empty($_SESSION)) { |
|
135 | + if (!empty($_SESSION)) { |
|
136 | 136 | foreach ($_SESSION as $key => $value) { |
137 | 137 | // Remplacez les données binaires par une chaîne pour éviter l'échec de json_encode. |
138 | 138 | if (is_string($value) && preg_match('~[^\x20-\x7E\t\r\n]~', $value)) { |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | $output = ''; |
206 | 206 | |
207 | 207 | foreach ($rows as $row) { |
208 | - $hasChildren = isset($row['children']) && ! empty($row['children']); |
|
209 | - $isQuery = isset($row['query']) && ! empty($row['query']); |
|
208 | + $hasChildren = isset($row['children']) && !empty($row['children']); |
|
209 | + $isQuery = isset($row['query']) && !empty($row['query']); |
|
210 | 210 | |
211 | 211 | // Ouvrir la chronologie du contrôleur par défaut |
212 | 212 | $open = $row['name'] === 'Controller'; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | // Le collecter |
273 | 273 | foreach ($collectors as $collector) { |
274 | - if (! $collector['hasTimelineData']) { |
|
274 | + if (!$collector['hasTimelineData']) { |
|
275 | 275 | continue; |
276 | 276 | } |
277 | 277 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | array_multisort(...$sortArray); |
289 | 289 | |
290 | 290 | // Ajouter une heure de fin à chaque élément |
291 | - array_walk($data, static function (&$row) { |
|
291 | + array_walk($data, static function(&$row) { |
|
292 | 292 | $row['end'] = $row['start'] + $row['duration']; |
293 | 293 | }); |
294 | 294 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | $element = array_shift($elements); |
308 | 308 | |
309 | 309 | // Si nous avons des enfants derrière nous, récupérez-les et attachez-les-nous |
310 | - while (! empty($elements) && $elements[array_key_first($elements)]['end'] <= $element['end']) { |
|
310 | + while (!empty($elements) && $elements[array_key_first($elements)]['end'] <= $element['end']) { |
|
311 | 311 | $element['children'][] = array_shift($elements); |
312 | 312 | } |
313 | 313 | |
@@ -331,14 +331,14 @@ discard block |
||
331 | 331 | */ |
332 | 332 | protected function collectVarData(): array |
333 | 333 | { |
334 | - if (! ($this->config->collectVarData ?? true)) { |
|
334 | + if (!($this->config->collectVarData ?? true)) { |
|
335 | 335 | return []; |
336 | 336 | } |
337 | 337 | |
338 | 338 | $data = []; |
339 | 339 | |
340 | 340 | foreach ($this->collectors as $collector) { |
341 | - if (! $collector->hasVarData()) { |
|
341 | + if (!$collector->hasVarData()) { |
|
342 | 342 | continue; |
343 | 343 | } |
344 | 344 | |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | } |
373 | 373 | |
374 | 374 | // Si on a desactiver le debogage ou l'affichage de la debugbar, on s'arrete |
375 | - if (! BLITZ_DEBUG || ! $this->config->show_debugbar) { |
|
375 | + if (!BLITZ_DEBUG || !$this->config->show_debugbar) { |
|
376 | 376 | return $response; |
377 | 377 | } |
378 | 378 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | // Mise à jour vers microtime() pour que nous puissions obtenir l'historique |
388 | 388 | $time = sprintf('%.6f', Date::now()->format('U.u')); |
389 | 389 | |
390 | - if (! is_dir($this->debugPath)) { |
|
390 | + if (!is_dir($this->debugPath)) { |
|
391 | 391 | mkdir($this->debugPath, 0777); |
392 | 392 | } |
393 | 393 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * the LICENSE file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -if (! function_exists('css_path')) { |
|
12 | +if (!function_exists('css_path')) { |
|
13 | 13 | /** |
14 | 14 | * CSS PATH |
15 | 15 | * |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function css_path(string $name = ''): string |
21 | 21 | { |
22 | - if (! empty($name)) { |
|
22 | + if (!empty($name)) { |
|
23 | 23 | $name = DS . ltrim($name, '/\\'); |
24 | 24 | } |
25 | 25 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | } |
28 | 28 | } |
29 | 29 | |
30 | -if (! function_exists('js_path')) { |
|
30 | +if (!function_exists('js_path')) { |
|
31 | 31 | /** |
32 | 32 | * JS PATH |
33 | 33 | * |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | function js_path(string $name = ''): string |
39 | 39 | { |
40 | - if (! empty($name)) { |
|
40 | + if (!empty($name)) { |
|
41 | 41 | $name = DS . ltrim($name, '/\\'); |
42 | 42 | } |
43 | 43 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | -if (! function_exists('lib_path')) { |
|
48 | +if (!function_exists('lib_path')) { |
|
49 | 49 | /** |
50 | 50 | * LIB PATH |
51 | 51 | * |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | function lib_path(string $name = ''): string |
57 | 57 | { |
58 | - if (! empty($name)) { |
|
58 | + if (!empty($name)) { |
|
59 | 59 | $name = DS . ltrim($name, '/\\'); |
60 | 60 | } |
61 | 61 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | -if (! function_exists('less_path')) { |
|
66 | +if (!function_exists('less_path')) { |
|
67 | 67 | /** |
68 | 68 | * LESS PATH |
69 | 69 | * |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | function less_path(string $name = ''): string |
75 | 75 | { |
76 | - if (! empty($name)) { |
|
76 | + if (!empty($name)) { |
|
77 | 77 | $name = DS . ltrim($name, '/\\'); |
78 | 78 | } |
79 | 79 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | -if (! function_exists('img_path')) { |
|
84 | +if (!function_exists('img_path')) { |
|
85 | 85 | /** |
86 | 86 | * IMG PATH |
87 | 87 | * |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | function img_path(string $name = ''): string |
93 | 93 | { |
94 | - if (! empty($name)) { |
|
94 | + if (!empty($name)) { |
|
95 | 95 | $name = DS . ltrim($name, '/\\'); |
96 | 96 | } |
97 | 97 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
102 | -if (! function_exists('docs_path')) { |
|
102 | +if (!function_exists('docs_path')) { |
|
103 | 103 | /** |
104 | 104 | * DOCS PATH |
105 | 105 | * |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | function docs_path(string $name = ''): string |
111 | 111 | { |
112 | - if (! empty($name)) { |
|
112 | + if (!empty($name)) { |
|
113 | 113 | $name = DS . ltrim($name, '/\\'); |
114 | 114 | } |
115 | 115 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | -if (! function_exists('video_path')) { |
|
120 | +if (!function_exists('video_path')) { |
|
121 | 121 | /** |
122 | 122 | * VIDEO PATH |
123 | 123 | * |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | function video_path(string $name = ''): string |
129 | 129 | { |
130 | - if (! empty($name)) { |
|
130 | + if (!empty($name)) { |
|
131 | 131 | $name = DS . ltrim($name, '/\\'); |
132 | 132 | } |
133 | 133 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
138 | -if (! function_exists('public_path')) { |
|
138 | +if (!function_exists('public_path')) { |
|
139 | 139 | /** |
140 | 140 | * PUBLIC PATH |
141 | 141 | * |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | function public_path(string $name = ''): string |
147 | 147 | { |
148 | - if (! empty($name)) { |
|
148 | + if (!empty($name)) { |
|
149 | 149 | $name = ltrim($name, '/\\'); |
150 | 150 | } |
151 | 151 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
156 | -if (! function_exists('root_path')) { |
|
156 | +if (!function_exists('root_path')) { |
|
157 | 157 | /** |
158 | 158 | * ROOT PATH |
159 | 159 | * |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | function root_path(string $name = ''): string |
165 | 165 | { |
166 | - if (! empty($name)) { |
|
166 | + if (!empty($name)) { |
|
167 | 167 | $name = ltrim($name, '/\\'); |
168 | 168 | } |
169 | 169 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | |
174 | -if (! function_exists('base_path')) { |
|
174 | +if (!function_exists('base_path')) { |
|
175 | 175 | /** |
176 | 176 | * BASE PATH |
177 | 177 | * |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | function base_path(string $name = ''): string |
183 | 183 | { |
184 | - if (! empty($name)) { |
|
184 | + if (!empty($name)) { |
|
185 | 185 | $name = ltrim($name, '/\\'); |
186 | 186 | } |
187 | 187 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | } |
190 | 190 | } |
191 | 191 | |
192 | -if (! function_exists('class_path')) { |
|
192 | +if (!function_exists('class_path')) { |
|
193 | 193 | /** |
194 | 194 | * CLASS PATH |
195 | 195 | * |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | */ |
200 | 200 | function class_path(string $name = ''): string |
201 | 201 | { |
202 | - if (! empty($name)) { |
|
202 | + if (!empty($name)) { |
|
203 | 203 | $name = DS . ltrim($name, '/\\'); |
204 | 204 | } |
205 | 205 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
210 | -if (! function_exists('config_path')) { |
|
210 | +if (!function_exists('config_path')) { |
|
211 | 211 | /** |
212 | 212 | * CONFIG PATH |
213 | 213 | * |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | */ |
218 | 218 | function config_path(string $name = ''): string |
219 | 219 | { |
220 | - if (! empty($name)) { |
|
220 | + if (!empty($name)) { |
|
221 | 221 | $name = DS . ltrim($name, '/\\'); |
222 | 222 | } |
223 | 223 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
228 | -if (! function_exists('controller_path')) { |
|
228 | +if (!function_exists('controller_path')) { |
|
229 | 229 | /** |
230 | 230 | * CONTROLLER PATH |
231 | 231 | * |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | */ |
237 | 237 | function controller_path(string $name = '', bool $only = true): string |
238 | 238 | { |
239 | - if (! empty($name)) { |
|
239 | + if (!empty($name)) { |
|
240 | 240 | $name = ltrim($name, '/\\'); |
241 | 241 | |
242 | - if ($only === true && ! preg_match('#Controller\.php$#', $name)) { |
|
242 | + if ($only === true && !preg_match('#Controller\.php$#', $name)) { |
|
243 | 243 | $name = ucfirst(strtolower($name)) . 'Controller.php'; |
244 | 244 | } |
245 | 245 | } |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | } |
249 | 249 | } |
250 | 250 | |
251 | -if (! function_exists('entity_path')) { |
|
251 | +if (!function_exists('entity_path')) { |
|
252 | 252 | /** |
253 | 253 | * ENTITY PATH |
254 | 254 | * |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | */ |
260 | 260 | function entity_path(string $name = '', bool $only = true): string |
261 | 261 | { |
262 | - if (! empty($name)) { |
|
262 | + if (!empty($name)) { |
|
263 | 263 | $name = ltrim($name, '/\\'); |
264 | 264 | |
265 | - if ($only === true && ! preg_match('#Entity\.php$#', $name)) { |
|
265 | + if ($only === true && !preg_match('#Entity\.php$#', $name)) { |
|
266 | 266 | $name = ucfirst($name) . 'Entity.php'; |
267 | 267 | } |
268 | 268 | } |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } |
272 | 272 | } |
273 | 273 | |
274 | -if (! function_exists('helper_path')) { |
|
274 | +if (!function_exists('helper_path')) { |
|
275 | 275 | /** |
276 | 276 | * HELPER PATH |
277 | 277 | * |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | */ |
283 | 283 | function helper_path(string $name = '', bool $system = false): string |
284 | 284 | { |
285 | - if (! empty($name)) { |
|
285 | + if (!empty($name)) { |
|
286 | 286 | $name = DS . ltrim($name, '/\\'); |
287 | 287 | } |
288 | 288 | if ($system === true) { |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | } |
294 | 294 | } |
295 | 295 | |
296 | -if (! function_exists('library_path')) { |
|
296 | +if (!function_exists('library_path')) { |
|
297 | 297 | /** |
298 | 298 | * LIBRARY PATH |
299 | 299 | * |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | */ |
305 | 305 | function library_path(string $name = '', bool $system = false): string |
306 | 306 | { |
307 | - if (! empty($name)) { |
|
307 | + if (!empty($name)) { |
|
308 | 308 | $name = DS . ltrim($name, '/\\'); |
309 | 309 | } |
310 | 310 | if ($system === true) { |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | } |
316 | 316 | } |
317 | 317 | |
318 | -if (! function_exists('middleware_path')) { |
|
318 | +if (!function_exists('middleware_path')) { |
|
319 | 319 | /** |
320 | 320 | * MIDDLEWARE PATH |
321 | 321 | * |
@@ -327,10 +327,10 @@ discard block |
||
327 | 327 | */ |
328 | 328 | function middleware_path(string $name = '', bool $system = false, bool $only = true): string |
329 | 329 | { |
330 | - if (! empty($name)) { |
|
330 | + if (!empty($name)) { |
|
331 | 331 | $name = DS . ltrim($name, '/\\'); |
332 | 332 | |
333 | - if ($only === true && ! preg_match('#Middleware\.php$#', $name)) { |
|
333 | + if ($only === true && !preg_match('#Middleware\.php$#', $name)) { |
|
334 | 334 | $name = ucfirst($name) . 'Middleware.php'; |
335 | 335 | } |
336 | 336 | } |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | } |
343 | 343 | } |
344 | 344 | |
345 | -if (! function_exists('model_path')) { |
|
345 | +if (!function_exists('model_path')) { |
|
346 | 346 | /** |
347 | 347 | * MODEL PATH |
348 | 348 | * |
@@ -353,10 +353,10 @@ discard block |
||
353 | 353 | */ |
354 | 354 | function model_path(string $name = '', bool $only = true): string |
355 | 355 | { |
356 | - if (! empty($name)) { |
|
356 | + if (!empty($name)) { |
|
357 | 357 | $name = ltrim($name, '/\\'); |
358 | 358 | |
359 | - if ($only === true && ! preg_match('#Model\.php$#', $name)) { |
|
359 | + if ($only === true && !preg_match('#Model\.php$#', $name)) { |
|
360 | 360 | $name = ucfirst(strtolower($name)) . 'Model.php'; |
361 | 361 | } |
362 | 362 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | } |
366 | 366 | } |
367 | 367 | |
368 | -if (! function_exists('resource_path')) { |
|
368 | +if (!function_exists('resource_path')) { |
|
369 | 369 | /** |
370 | 370 | * RESOURCE PATH |
371 | 371 | * |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | */ |
376 | 376 | function resource_path(string $name = ''): string |
377 | 377 | { |
378 | - if (! empty($name)) { |
|
378 | + if (!empty($name)) { |
|
379 | 379 | $name = ltrim($name, '/\\'); |
380 | 380 | } |
381 | 381 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | } |
384 | 384 | } |
385 | 385 | |
386 | -if (! function_exists('migration_path')) { |
|
386 | +if (!function_exists('migration_path')) { |
|
387 | 387 | /** |
388 | 388 | * MIGRATION PATH |
389 | 389 | * |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | */ |
394 | 394 | function migration_path(string $name = ''): string |
395 | 395 | { |
396 | - if (! empty($name)) { |
|
396 | + if (!empty($name)) { |
|
397 | 397 | $name = ltrim($name, '/\\'); |
398 | 398 | } |
399 | 399 | |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | } |
402 | 402 | } |
403 | 403 | |
404 | -if (! function_exists('seed_path')) { |
|
404 | +if (!function_exists('seed_path')) { |
|
405 | 405 | /** |
406 | 406 | * SEED PATH |
407 | 407 | * |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | */ |
412 | 412 | function seed_path(string $name = ''): string |
413 | 413 | { |
414 | - if (! empty($name)) { |
|
414 | + if (!empty($name)) { |
|
415 | 415 | $name = ltrim($name, '/\\'); |
416 | 416 | } |
417 | 417 | |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | } |
420 | 420 | } |
421 | 421 | |
422 | -if (! function_exists('lang_path')) { |
|
422 | +if (!function_exists('lang_path')) { |
|
423 | 423 | /** |
424 | 424 | * LANG PATH |
425 | 425 | * |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | */ |
431 | 431 | function lang_path(string $name = '', bool $system = false): string |
432 | 432 | { |
433 | - if (! empty($name)) { |
|
433 | + if (!empty($name)) { |
|
434 | 434 | $name = DS . ltrim($name, '/\\'); |
435 | 435 | } |
436 | 436 | if ($system === true) { |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | } |
442 | 442 | } |
443 | 443 | |
444 | -if (! function_exists('service_path')) { |
|
444 | +if (!function_exists('service_path')) { |
|
445 | 445 | /** |
446 | 446 | * SERVICE PATH |
447 | 447 | * |
@@ -452,10 +452,10 @@ discard block |
||
452 | 452 | */ |
453 | 453 | function service_path(string $name = '', bool $only = true): string |
454 | 454 | { |
455 | - if (! empty($name)) { |
|
455 | + if (!empty($name)) { |
|
456 | 456 | $name = ltrim($name, '/\\'); |
457 | 457 | |
458 | - if ($only === true && ! preg_match('#Service\.php$#', $name)) { |
|
458 | + if ($only === true && !preg_match('#Service\.php$#', $name)) { |
|
459 | 459 | $name = ucfirst($name) . 'Service.php'; |
460 | 460 | } |
461 | 461 | } |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | } |
465 | 465 | } |
466 | 466 | |
467 | -if (! function_exists('view_path')) { |
|
467 | +if (!function_exists('view_path')) { |
|
468 | 468 | /** |
469 | 469 | * VIEW PATH |
470 | 470 | * |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | */ |
475 | 475 | function view_path(string $name = ''): string |
476 | 476 | { |
477 | - if (! empty($name)) { |
|
477 | + if (!empty($name)) { |
|
478 | 478 | $name = ltrim($name, '/\\'); |
479 | 479 | } |
480 | 480 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | } |
483 | 483 | } |
484 | 484 | |
485 | -if (! function_exists('layout_path')) { |
|
485 | +if (!function_exists('layout_path')) { |
|
486 | 486 | /** |
487 | 487 | * LAYOUT PATH |
488 | 488 | * |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | */ |
493 | 493 | function layout_path(string $name = ''): string |
494 | 494 | { |
495 | - if (! empty($name)) { |
|
495 | + if (!empty($name)) { |
|
496 | 496 | $name = ltrim($name, '/\\'); |
497 | 497 | } |
498 | 498 | |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | } |
501 | 501 | } |
502 | 502 | |
503 | -if (! function_exists('partial_path')) { |
|
503 | +if (!function_exists('partial_path')) { |
|
504 | 504 | /** |
505 | 505 | * PARTIAL PATH |
506 | 506 | * |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | */ |
511 | 511 | function partial_path(string $name = ''): string |
512 | 512 | { |
513 | - if (! empty($name)) { |
|
513 | + if (!empty($name)) { |
|
514 | 514 | $name = DS . ltrim($name, '/\\'); |
515 | 515 | } |
516 | 516 | |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | } |
519 | 519 | } |
520 | 520 | |
521 | -if (! function_exists('app_path')) { |
|
521 | +if (!function_exists('app_path')) { |
|
522 | 522 | /** |
523 | 523 | * APP PATH |
524 | 524 | * |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | */ |
529 | 529 | function app_path(string $name = ''): string |
530 | 530 | { |
531 | - if (! empty($name)) { |
|
531 | + if (!empty($name)) { |
|
532 | 532 | $name = ltrim($name, '/\\'); |
533 | 533 | } |
534 | 534 | |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | } |
537 | 537 | } |
538 | 538 | |
539 | -if (! function_exists('cache_path')) { |
|
539 | +if (!function_exists('cache_path')) { |
|
540 | 540 | /** |
541 | 541 | * CACHE PATH |
542 | 542 | * |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | */ |
547 | 547 | function cache_path(string $name = ''): string |
548 | 548 | { |
549 | - if (! empty($name)) { |
|
549 | + if (!empty($name)) { |
|
550 | 550 | $name = ltrim($name, '/\\'); |
551 | 551 | } |
552 | 552 | |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | } |
555 | 555 | } |
556 | 556 | |
557 | -if (! function_exists('dump_path')) { |
|
557 | +if (!function_exists('dump_path')) { |
|
558 | 558 | /** |
559 | 559 | * DUMP PATH |
560 | 560 | * |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | */ |
565 | 565 | function dump_path(string $name = ''): string |
566 | 566 | { |
567 | - if (! empty($name)) { |
|
567 | + if (!empty($name)) { |
|
568 | 568 | $name = ltrim($name, '/\\'); |
569 | 569 | } |
570 | 570 | |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | } |
573 | 573 | } |
574 | 574 | |
575 | -if (! function_exists('storage_path')) { |
|
575 | +if (!function_exists('storage_path')) { |
|
576 | 576 | /** |
577 | 577 | * STORAGE PATH |
578 | 578 | * |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | */ |
583 | 583 | function storage_path(string $name = ''): string |
584 | 584 | { |
585 | - if (! empty($name)) { |
|
585 | + if (!empty($name)) { |
|
586 | 586 | $name = ltrim($name, '/\\'); |
587 | 587 | } |
588 | 588 | |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | } |
591 | 591 | } |
592 | 592 | |
593 | -if (! function_exists('css_exist')) { |
|
593 | +if (!function_exists('css_exist')) { |
|
594 | 594 | /** |
595 | 595 | * CSS EXIST |
596 | 596 | * |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | } |
605 | 605 | } |
606 | 606 | |
607 | -if (! function_exists('js_exist')) { |
|
607 | +if (!function_exists('js_exist')) { |
|
608 | 608 | /** |
609 | 609 | * JS EXIST |
610 | 610 | * |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | } |
619 | 619 | } |
620 | 620 | |
621 | -if (! function_exists('lib_exist')) { |
|
621 | +if (!function_exists('lib_exist')) { |
|
622 | 622 | /** |
623 | 623 | * LIB EXIST |
624 | 624 | * |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | } |
633 | 633 | } |
634 | 634 | |
635 | -if (! function_exists('less_exist')) { |
|
635 | +if (!function_exists('less_exist')) { |
|
636 | 636 | /** |
637 | 637 | * LESS EXIST |
638 | 638 | * |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | } |
647 | 647 | } |
648 | 648 | |
649 | -if (! function_exists('img_exist')) { |
|
649 | +if (!function_exists('img_exist')) { |
|
650 | 650 | /** |
651 | 651 | * IMG EXIST |
652 | 652 | * |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | } |
661 | 661 | } |
662 | 662 | |
663 | -if (! function_exists('doc_exist')) { |
|
663 | +if (!function_exists('doc_exist')) { |
|
664 | 664 | /** |
665 | 665 | * DOC EXIST |
666 | 666 | * |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | } |
675 | 675 | } |
676 | 676 | |
677 | -if (! function_exists('video_exist')) { |
|
677 | +if (!function_exists('video_exist')) { |
|
678 | 678 | /** |
679 | 679 | * VIDEO EXIST |
680 | 680 | * |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | } |
689 | 689 | } |
690 | 690 | |
691 | -if (! function_exists('public_exist')) { |
|
691 | +if (!function_exists('public_exist')) { |
|
692 | 692 | /** |
693 | 693 | * PUBLIC EXIST |
694 | 694 | * |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | } |
703 | 703 | } |
704 | 704 | |
705 | -if (! function_exists('class_exist')) { |
|
705 | +if (!function_exists('class_exist')) { |
|
706 | 706 | /** |
707 | 707 | * CLASS EXIST |
708 | 708 | * |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | } |
717 | 717 | } |
718 | 718 | |
719 | -if (! function_exists('config_exist')) { |
|
719 | +if (!function_exists('config_exist')) { |
|
720 | 720 | /** |
721 | 721 | * CONFIG EXIST |
722 | 722 | * |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | } |
731 | 731 | } |
732 | 732 | |
733 | -if (! function_exists('controller_exist')) { |
|
733 | +if (!function_exists('controller_exist')) { |
|
734 | 734 | /** |
735 | 735 | * CONTROLLER EXIST |
736 | 736 | * |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | } |
746 | 746 | } |
747 | 747 | |
748 | -if (! function_exists('entity_exist')) { |
|
748 | +if (!function_exists('entity_exist')) { |
|
749 | 749 | /** |
750 | 750 | * ENTITY EXIST |
751 | 751 | * |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | } |
761 | 761 | } |
762 | 762 | |
763 | -if (! function_exists('helper_exist')) { |
|
763 | +if (!function_exists('helper_exist')) { |
|
764 | 764 | /** |
765 | 765 | * HELPER EXIST |
766 | 766 | * |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | } |
776 | 776 | } |
777 | 777 | |
778 | -if (! function_exists('library_exist')) { |
|
778 | +if (!function_exists('library_exist')) { |
|
779 | 779 | /** |
780 | 780 | * LIBRARY EXIST |
781 | 781 | * |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | } |
791 | 791 | } |
792 | 792 | |
793 | -if (! function_exists('middleware_exist')) { |
|
793 | +if (!function_exists('middleware_exist')) { |
|
794 | 794 | /** |
795 | 795 | * MIDDLEWARE EXIST |
796 | 796 | * |
@@ -806,7 +806,7 @@ discard block |
||
806 | 806 | } |
807 | 807 | } |
808 | 808 | |
809 | -if (! function_exists('model_exist')) { |
|
809 | +if (!function_exists('model_exist')) { |
|
810 | 810 | /** |
811 | 811 | * MODEL EXIST |
812 | 812 | * |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | } |
822 | 822 | } |
823 | 823 | |
824 | -if (! function_exists('resource_exist')) { |
|
824 | +if (!function_exists('resource_exist')) { |
|
825 | 825 | /** |
826 | 826 | * RESOURCE EXIST |
827 | 827 | * |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | } |
836 | 836 | } |
837 | 837 | |
838 | -if (! function_exists('migration_exist')) { |
|
838 | +if (!function_exists('migration_exist')) { |
|
839 | 839 | /** |
840 | 840 | * MIGRATION EXIST |
841 | 841 | * |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | } |
850 | 850 | } |
851 | 851 | |
852 | -if (! function_exists('seed_exist')) { |
|
852 | +if (!function_exists('seed_exist')) { |
|
853 | 853 | /** |
854 | 854 | * SEED EXIST |
855 | 855 | * |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | } |
864 | 864 | } |
865 | 865 | |
866 | -if (! function_exists('lang_exist')) { |
|
866 | +if (!function_exists('lang_exist')) { |
|
867 | 867 | /** |
868 | 868 | * LANG EXIST |
869 | 869 | * |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | } |
879 | 879 | } |
880 | 880 | |
881 | -if (! function_exists('service_exist')) { |
|
881 | +if (!function_exists('service_exist')) { |
|
882 | 882 | /** |
883 | 883 | * SERVICE EXIST |
884 | 884 | * |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | } |
894 | 894 | } |
895 | 895 | |
896 | -if (! function_exists('view_exist')) { |
|
896 | +if (!function_exists('view_exist')) { |
|
897 | 897 | /** |
898 | 898 | * VIEW EXIST |
899 | 899 | * |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | } |
908 | 908 | } |
909 | 909 | |
910 | -if (! function_exists('layout_exist')) { |
|
910 | +if (!function_exists('layout_exist')) { |
|
911 | 911 | /** |
912 | 912 | * LAYOUT EXIST |
913 | 913 | * |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | } |
922 | 922 | } |
923 | 923 | |
924 | -if (! function_exists('partial_exist')) { |
|
924 | +if (!function_exists('partial_exist')) { |
|
925 | 925 | /** |
926 | 926 | * PARTIAL EXIST |
927 | 927 | * |
@@ -935,7 +935,7 @@ discard block |
||
935 | 935 | } |
936 | 936 | } |
937 | 937 | |
938 | -if (! function_exists('app_exist')) { |
|
938 | +if (!function_exists('app_exist')) { |
|
939 | 939 | /** |
940 | 940 | * APP EXIST |
941 | 941 | * |
@@ -949,7 +949,7 @@ discard block |
||
949 | 949 | } |
950 | 950 | } |
951 | 951 | |
952 | -if (! function_exists('cache_exist')) { |
|
952 | +if (!function_exists('cache_exist')) { |
|
953 | 953 | /** |
954 | 954 | * CACHE EXIST |
955 | 955 | * |
@@ -963,7 +963,7 @@ discard block |
||
963 | 963 | } |
964 | 964 | } |
965 | 965 | |
966 | -if (! function_exists('dump_exist')) { |
|
966 | +if (!function_exists('dump_exist')) { |
|
967 | 967 | /** |
968 | 968 | * DUMP EXIST |
969 | 969 | * |
@@ -977,7 +977,7 @@ discard block |
||
977 | 977 | } |
978 | 978 | } |
979 | 979 | |
980 | -if (! function_exists('storage_exist')) { |
|
980 | +if (!function_exists('storage_exist')) { |
|
981 | 981 | /** |
982 | 982 | * STORAGE EXIST |
983 | 983 | * |
@@ -991,7 +991,7 @@ discard block |
||
991 | 991 | } |
992 | 992 | } |
993 | 993 | |
994 | -if (! function_exists('include_config')) { |
|
994 | +if (!function_exists('include_config')) { |
|
995 | 995 | /** |
996 | 996 | * INCLUDE CONFIG |
997 | 997 | * |
@@ -1009,7 +1009,7 @@ discard block |
||
1009 | 1009 | } |
1010 | 1010 | } |
1011 | 1011 | |
1012 | -if (! function_exists('include_controller')) { |
|
1012 | +if (!function_exists('include_controller')) { |
|
1013 | 1013 | /** |
1014 | 1014 | * INCLUDE CONTROLLER |
1015 | 1015 | * |
@@ -1028,7 +1028,7 @@ discard block |
||
1028 | 1028 | } |
1029 | 1029 | } |
1030 | 1030 | |
1031 | -if (! function_exists('include_class')) { |
|
1031 | +if (!function_exists('include_class')) { |
|
1032 | 1032 | /** |
1033 | 1033 | * INCLUDE CLASS |
1034 | 1034 | * |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | } |
1047 | 1047 | } |
1048 | 1048 | |
1049 | -if (! function_exists('include_entity')) { |
|
1049 | +if (!function_exists('include_entity')) { |
|
1050 | 1050 | /** |
1051 | 1051 | * INCLUDE ENTITY |
1052 | 1052 | * |
@@ -1065,7 +1065,7 @@ discard block |
||
1065 | 1065 | } |
1066 | 1066 | } |
1067 | 1067 | |
1068 | -if (! function_exists('include_helper')) { |
|
1068 | +if (!function_exists('include_helper')) { |
|
1069 | 1069 | /** |
1070 | 1070 | * INCLUDE HELPER |
1071 | 1071 | * |
@@ -1083,7 +1083,7 @@ discard block |
||
1083 | 1083 | } |
1084 | 1084 | } |
1085 | 1085 | |
1086 | -if (! function_exists('include_library')) { |
|
1086 | +if (!function_exists('include_library')) { |
|
1087 | 1087 | /** |
1088 | 1088 | * INCLUDE LIBRARY |
1089 | 1089 | * |
@@ -1102,7 +1102,7 @@ discard block |
||
1102 | 1102 | } |
1103 | 1103 | } |
1104 | 1104 | |
1105 | -if (! function_exists('include_middleware')) { |
|
1105 | +if (!function_exists('include_middleware')) { |
|
1106 | 1106 | /** |
1107 | 1107 | * INCLUDE MIDDLEWARE |
1108 | 1108 | * |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | } |
1123 | 1123 | } |
1124 | 1124 | |
1125 | -if (! function_exists('include_model')) { |
|
1125 | +if (!function_exists('include_model')) { |
|
1126 | 1126 | /** |
1127 | 1127 | * INCLUDE MODEL |
1128 | 1128 | * |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | } |
1142 | 1142 | } |
1143 | 1143 | |
1144 | -if (! function_exists('include_resource')) { |
|
1144 | +if (!function_exists('include_resource')) { |
|
1145 | 1145 | /** |
1146 | 1146 | * INCLUDE RESOURCE |
1147 | 1147 | * |
@@ -1159,7 +1159,7 @@ discard block |
||
1159 | 1159 | } |
1160 | 1160 | } |
1161 | 1161 | |
1162 | -if (! function_exists('include_service')) { |
|
1162 | +if (!function_exists('include_service')) { |
|
1163 | 1163 | /** |
1164 | 1164 | * INCLUDE SERVICE |
1165 | 1165 | * |
@@ -1178,7 +1178,7 @@ discard block |
||
1178 | 1178 | } |
1179 | 1179 | } |
1180 | 1180 | |
1181 | -if (! function_exists('include_view')) { |
|
1181 | +if (!function_exists('include_view')) { |
|
1182 | 1182 | /** |
1183 | 1183 | * INCLUDE VIEW |
1184 | 1184 | * |
@@ -1196,7 +1196,7 @@ discard block |
||
1196 | 1196 | } |
1197 | 1197 | } |
1198 | 1198 | |
1199 | -if (! function_exists('include_layout')) { |
|
1199 | +if (!function_exists('include_layout')) { |
|
1200 | 1200 | /** |
1201 | 1201 | * INCLUDE LAYOUT |
1202 | 1202 | * |
@@ -1214,7 +1214,7 @@ discard block |
||
1214 | 1214 | } |
1215 | 1215 | } |
1216 | 1216 | |
1217 | -if (! function_exists('include_partial')) { |
|
1217 | +if (!function_exists('include_partial')) { |
|
1218 | 1218 | /** |
1219 | 1219 | * INCLUDE PARTIAL |
1220 | 1220 | * |
@@ -1232,7 +1232,7 @@ discard block |
||
1232 | 1232 | } |
1233 | 1233 | } |
1234 | 1234 | |
1235 | -if (! function_exists('_include_path')) { |
|
1235 | +if (!function_exists('_include_path')) { |
|
1236 | 1236 | /** |
1237 | 1237 | * inclus un fichier |
1238 | 1238 | * |
@@ -25,49 +25,49 @@ discard block |
||
25 | 25 | */ |
26 | 26 | private static array $loaded = []; |
27 | 27 | |
28 | - /** |
|
29 | - * Drapeau permettant de savoir si la config a deja ete initialiser |
|
30 | - */ |
|
31 | - private static bool $initialized = false; |
|
28 | + /** |
|
29 | + * Drapeau permettant de savoir si la config a deja ete initialiser |
|
30 | + */ |
|
31 | + private static bool $initialized = false; |
|
32 | 32 | |
33 | - private Configurator $configurator; |
|
33 | + private Configurator $configurator; |
|
34 | 34 | |
35 | 35 | public function __construct() |
36 | 36 | { |
37 | - $this->configurator = new Configurator(); |
|
38 | - $this->initialize(); |
|
37 | + $this->configurator = new Configurator(); |
|
38 | + $this->initialize(); |
|
39 | 39 | } |
40 | 40 | |
41 | - /** |
|
41 | + /** |
|
42 | 42 | * Détermine si une clé de configuration existe. |
43 | 43 | */ |
44 | - public function exists(string $key): bool |
|
45 | - { |
|
46 | - if (! $this->configurator->exists($key)) { |
|
47 | - $config = explode('.', $key); |
|
48 | - $this->load($config[0]); |
|
44 | + public function exists(string $key): bool |
|
45 | + { |
|
46 | + if (! $this->configurator->exists($key)) { |
|
47 | + $config = explode('.', $key); |
|
48 | + $this->load($config[0]); |
|
49 | 49 | |
50 | - return $this->configurator->exists(implode('.', $config)); |
|
51 | - } |
|
50 | + return $this->configurator->exists(implode('.', $config)); |
|
51 | + } |
|
52 | 52 | |
53 | - return true; |
|
54 | - } |
|
53 | + return true; |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
56 | + /** |
|
57 | 57 | * Détermine s'il y'a une clé de configuration. |
58 | 58 | */ |
59 | - public function has(string $key): bool |
|
60 | - { |
|
61 | - return $this->exists($key); |
|
62 | - } |
|
59 | + public function has(string $key): bool |
|
60 | + { |
|
61 | + return $this->exists($key); |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
64 | + /** |
|
65 | 65 | * Détermine s'il manque une clé de configuration. |
66 | 66 | */ |
67 | - public function missing(string $key): bool |
|
68 | - { |
|
69 | - return ! $this->exists($key); |
|
70 | - } |
|
67 | + public function missing(string $key): bool |
|
68 | + { |
|
69 | + return ! $this->exists($key); |
|
70 | + } |
|
71 | 71 | |
72 | 72 | /** |
73 | 73 | * Renvoyer une configuration de l'application |
@@ -80,21 +80,21 @@ discard block |
||
80 | 80 | return $this->configurator->get($key); |
81 | 81 | } |
82 | 82 | |
83 | - if (func_num_args() > 1) { |
|
84 | - return $default; |
|
85 | - } |
|
83 | + if (func_num_args() > 1) { |
|
84 | + return $default; |
|
85 | + } |
|
86 | 86 | |
87 | - $path = explode('.', $key); |
|
87 | + $path = explode('.', $key); |
|
88 | 88 | |
89 | - throw ConfigException::notFound(implode(' » ', $path)); |
|
90 | - } |
|
89 | + throw ConfigException::notFound(implode(' » ', $path)); |
|
90 | + } |
|
91 | 91 | |
92 | 92 | /** |
93 | 93 | * Définir une configuration de l'application |
94 | 94 | */ |
95 | 95 | public function set(string $key, $value) |
96 | 96 | { |
97 | - $this->configurator->set($key, $value); |
|
97 | + $this->configurator->set($key, $value); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | $schema = self::schema($config); |
133 | 133 | } |
134 | 134 | |
135 | - $this->configurator->addSchema($config, $schema, false); |
|
136 | - $this->configurator->merge([$config => (array) $configurations]); |
|
135 | + $this->configurator->addSchema($config, $schema, false); |
|
136 | + $this->configurator->merge([$config => (array) $configurations]); |
|
137 | 137 | |
138 | 138 | self::$loaded[$config] = $file; |
139 | 139 | } |
@@ -163,17 +163,17 @@ discard block |
||
163 | 163 | { |
164 | 164 | $path = preg_replace('#\.php$#', '', $path); |
165 | 165 | |
166 | - if (file_exists($file = CONFIG_PATH . $path . '.php')) { |
|
167 | - return $file; |
|
168 | - } |
|
166 | + if (file_exists($file = CONFIG_PATH . $path . '.php')) { |
|
167 | + return $file; |
|
168 | + } |
|
169 | 169 | |
170 | - $paths = Services::locator()->search('Config/' . $path); |
|
170 | + $paths = Services::locator()->search('Config/' . $path); |
|
171 | 171 | |
172 | - if (isset($paths[0]) && file_exists($path[0])) { |
|
173 | - return $paths[0]; |
|
174 | - } |
|
172 | + if (isset($paths[0]) && file_exists($path[0])) { |
|
173 | + return $paths[0]; |
|
174 | + } |
|
175 | 175 | |
176 | - return ''; |
|
176 | + return ''; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | */ |
204 | 204 | private function initialize() |
205 | 205 | { |
206 | - if (self::$initialized) { |
|
207 | - return; |
|
208 | - } |
|
206 | + if (self::$initialized) { |
|
207 | + return; |
|
208 | + } |
|
209 | 209 | |
210 | - $this->load(['app']); |
|
210 | + $this->load(['app']); |
|
211 | 211 | |
212 | 212 | ini_set('log_errors', 1); |
213 | 213 | ini_set('error_log', LOG_PATH . 'blitz-logs'); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $this->initializeEnvironment(); |
217 | 217 | $this->initializeDebugbar(); |
218 | 218 | |
219 | - self::$initialized = true; |
|
219 | + self::$initialized = true; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | /** |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function exists(string $key): bool |
45 | 45 | { |
46 | - if (! $this->configurator->exists($key)) { |
|
46 | + if (!$this->configurator->exists($key)) { |
|
47 | 47 | $config = explode('.', $key); |
48 | 48 | $this->load($config[0]); |
49 | 49 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function missing(string $key): bool |
68 | 68 | { |
69 | - return ! $this->exists($key); |
|
69 | + return !$this->exists($key); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | if (is_array($config)) { |
108 | 108 | foreach ($config as $key => $value) { |
109 | - if (! is_string($value) || empty($value)) { |
|
109 | + if (!is_string($value) || empty($value)) { |
|
110 | 110 | continue; |
111 | 111 | } |
112 | 112 | if (is_string($key)) { |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | } |
119 | 119 | self::load($conf, $file); |
120 | 120 | } |
121 | - } elseif (is_string($config) && ! isset(self::$loaded[$config])) { |
|
121 | + } elseif (is_string($config) && !isset(self::$loaded[$config])) { |
|
122 | 122 | if (empty($file)) { |
123 | 123 | $file = self::path($config); |
124 | 124 | } |
125 | 125 | |
126 | 126 | $configurations = []; |
127 | - if (file_exists($file) && ! in_array($file, get_included_files(), true)) { |
|
127 | + if (file_exists($file) && !in_array($file, get_included_files(), true)) { |
|
128 | 128 | $configurations = (array) require $file; |
129 | 129 | } |
130 | 130 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | { |
150 | 150 | if (is_array($accepts_values)) { |
151 | 151 | $accepts_values = '(Accept values: ' . implode('/', $accepts_values) . ')'; |
152 | - } elseif (! is_string($accepts_values)) { |
|
152 | + } elseif (!is_string($accepts_values)) { |
|
153 | 153 | throw new InvalidArgumentException('Misuse of the method ' . __METHOD__); |
154 | 154 | } |
155 | 155 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $schema = require $app_schema; |
192 | 192 | } |
193 | 193 | |
194 | - if (empty($schema) || ! ($schema instanceof Schema)) { |
|
194 | + if (empty($schema) || !($schema instanceof Schema)) { |
|
195 | 195 | $schema = Expect::mixed(); |
196 | 196 | } |
197 | 197 | |
@@ -278,12 +278,12 @@ discard block |
||
278 | 278 | { |
279 | 279 | $config = $this->get('app.show_debugbar', 'auto'); |
280 | 280 | |
281 | - if (! in_array($config, ['auto', true, false], true)) { |
|
281 | + if (!in_array($config, ['auto', true, false], true)) { |
|
282 | 282 | self::exceptBadConfigValue('show_debugbar', ['auto', true, false], 'app'); |
283 | 283 | } |
284 | 284 | |
285 | 285 | if ($config === 'auto') { |
286 | - $this->set('app.show_debugbar', ! is_online()); |
|
286 | + $this->set('app.show_debugbar', !is_online()); |
|
287 | 287 | } |
288 | 288 | } |
289 | 289 | } |
@@ -115,18 +115,18 @@ |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | if (! function_exists('config')) { |
118 | - /** |
|
118 | + /** |
|
119 | 119 | * GET/SET App config |
120 | 120 | * |
121 | 121 | * @return Config|mixed|void |
122 | 122 | */ |
123 | 123 | function config(array|string|null $key = null, $default = null) |
124 | 124 | { |
125 | - $config = Services::config(); |
|
125 | + $config = Services::config(); |
|
126 | 126 | |
127 | - if (null === $key) { |
|
128 | - return $config; |
|
129 | - } |
|
127 | + if (null === $key) { |
|
128 | + return $config; |
|
129 | + } |
|
130 | 130 | |
131 | 131 | if (is_string($key)) { |
132 | 132 | return $config->get($key, $default); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | // ================================= FONCTIONS D'ACCESSIBILITE ================================= // |
27 | 27 | |
28 | -if (! function_exists('env')) { |
|
28 | +if (!function_exists('env')) { |
|
29 | 29 | /** |
30 | 30 | * Obtient une variable d'environnement à partir des sources disponibles et fournit une émulation |
31 | 31 | * pour les variables d'environnement non prises en charge ou incohérentes |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | -if (! function_exists('helper')) { |
|
44 | +if (!function_exists('helper')) { |
|
45 | 45 | /** |
46 | 46 | * Charge un fichier d'aide en mémoire. Prend en charge les assistants d'espace de noms, |
47 | 47 | * à la fois dans et hors du répertoire 'helpers' d'un répertoire à espace de noms. |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | -if (! function_exists('model')) { |
|
60 | +if (!function_exists('model')) { |
|
61 | 61 | /** |
62 | 62 | * Simple maniere d'obtenir un modele. |
63 | 63 | * |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @return T |
69 | 69 | */ |
70 | - function model(string|array $name, ?ConnectionInterface &$conn = null) |
|
70 | + function model(string|array $name, ?ConnectionInterface&$conn = null) |
|
71 | 71 | { |
72 | 72 | return Load::model($name, $conn); |
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | -if (! function_exists('service')) { |
|
76 | +if (!function_exists('service')) { |
|
77 | 77 | /** |
78 | 78 | * Permet un accès plus propre au fichier de configuration des services. |
79 | 79 | * Renvoie toujours une instance SHARED de la classe, donc |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
93 | -if (! function_exists('single_service')) { |
|
93 | +if (!function_exists('single_service')) { |
|
94 | 94 | /** |
95 | 95 | * Autoriser l'accès propre à un service. |
96 | 96 | * Renvoie toujours une nouvelle instance de la classe. |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | } |
106 | 106 | |
107 | -if (! function_exists('show404')) { |
|
107 | +if (!function_exists('show404')) { |
|
108 | 108 | /** |
109 | 109 | * Afficher une page 404 introuvable dans le navigateur |
110 | 110 | */ |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
117 | -if (! function_exists('config')) { |
|
117 | +if (!function_exists('config')) { |
|
118 | 118 | /** |
119 | 119 | * GET/SET App config |
120 | 120 | * |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | // =========================== FONCTIONS DE PREVENTION D'ATTAQUE =========================== // |
144 | 144 | |
145 | -if (! function_exists('esc')) { |
|
145 | +if (!function_exists('esc')) { |
|
146 | 146 | /** |
147 | 147 | * Effectue un simple échappement automatique des données pour des raisons de sécurité. |
148 | 148 | * Pourrait envisager de rendre cela plus complexe à une date ultérieure. |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | } |
171 | 171 | |
172 | -if (! function_exists('h')) { |
|
172 | +if (!function_exists('h')) { |
|
173 | 173 | /** |
174 | 174 | * Méthode pratique pour htmlspecialchars. |
175 | 175 | * |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | } |
189 | 189 | } |
190 | 190 | |
191 | -if (! function_exists('purify')) { |
|
191 | +if (!function_exists('purify')) { |
|
192 | 192 | /** |
193 | 193 | * Purifiez l'entrée à l'aide de la classe autonome HTMLPurifier. |
194 | 194 | * Utilisez facilement plusieurs configurations de purificateur. |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | } |
207 | 207 | } |
208 | 208 | |
209 | -if (! function_exists('remove_invisible_characters')) { |
|
209 | +if (!function_exists('remove_invisible_characters')) { |
|
210 | 210 | /** |
211 | 211 | * Supprimer les caractères invisibles |
212 | 212 | * |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | } |
220 | 220 | } |
221 | 221 | |
222 | -if (! function_exists('stringify_attributes')) { |
|
222 | +if (!function_exists('stringify_attributes')) { |
|
223 | 223 | /** |
224 | 224 | * Chaîner les attributs à utiliser dans les balises HTML. |
225 | 225 | * |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | // ================================= FONCTIONS D'ENVIRONNEMENT D'EXECUTION ================================= // |
235 | 235 | |
236 | -if (! function_exists('on_dev')) { |
|
236 | +if (!function_exists('on_dev')) { |
|
237 | 237 | /** |
238 | 238 | * Testez pour voir si nous sommes dans un environnement de développement. |
239 | 239 | */ |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
252 | -if (! function_exists('on_prod')) { |
|
252 | +if (!function_exists('on_prod')) { |
|
253 | 253 | /** |
254 | 254 | * Testez pour voir si nous sommes dans un environnement de production. |
255 | 255 | */ |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | } |
266 | 266 | } |
267 | 267 | |
268 | -if (! function_exists('on_test')) { |
|
268 | +if (!function_exists('on_test')) { |
|
269 | 269 | /** |
270 | 270 | * Testez pour voir si nous sommes dans un environnement de test |
271 | 271 | */ |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | } |
278 | 278 | } |
279 | 279 | |
280 | -if (! function_exists('is_cli')) { |
|
280 | +if (!function_exists('is_cli')) { |
|
281 | 281 | /** |
282 | 282 | * Testez pour voir si une demande a été faite à partir de la ligne de commande. |
283 | 283 | */ |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | } |
288 | 288 | } |
289 | 289 | |
290 | -if (! function_exists('is_php')) { |
|
290 | +if (!function_exists('is_php')) { |
|
291 | 291 | /** |
292 | 292 | * Détermine si la version actuelle de PHP est égale ou supérieure à la valeur fournie. |
293 | 293 | */ |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | } |
298 | 298 | } |
299 | 299 | |
300 | -if (! function_exists('is_windows')) { |
|
300 | +if (!function_exists('is_windows')) { |
|
301 | 301 | /** |
302 | 302 | * Déterminez si l'environnement actuel est basé sur Windows. |
303 | 303 | */ |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | } |
309 | 309 | |
310 | -if (! function_exists('is_https')) { |
|
310 | +if (!function_exists('is_https')) { |
|
311 | 311 | /** |
312 | 312 | * Determines if the application is accessed via an encrypted * (HTTPS) connection. |
313 | 313 | */ |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | } |
318 | 318 | } |
319 | 319 | |
320 | -if (! function_exists('is_localfile')) { |
|
320 | +if (!function_exists('is_localfile')) { |
|
321 | 321 | /** |
322 | 322 | * Vérifiez si le fichier auquel vous souhaitez accéder est un fichier local de votre application ou non |
323 | 323 | */ |
@@ -327,11 +327,11 @@ discard block |
||
327 | 327 | return true; |
328 | 328 | } |
329 | 329 | |
330 | - return ! preg_match('#^(https?://)#i', $name); |
|
330 | + return !preg_match('#^(https?://)#i', $name); |
|
331 | 331 | } |
332 | 332 | } |
333 | 333 | |
334 | -if (! function_exists('is_online')) { |
|
334 | +if (!function_exists('is_online')) { |
|
335 | 335 | /** |
336 | 336 | * Tester si l'application s'exécute en local ou en ligne. |
337 | 337 | */ |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | } |
342 | 342 | } |
343 | 343 | |
344 | -if (! function_exists('is_connected')) { |
|
344 | +if (!function_exists('is_connected')) { |
|
345 | 345 | /** |
346 | 346 | * Verifie si l'utilisateur a une connexion internet active. |
347 | 347 | */ |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | } |
352 | 352 | } |
353 | 353 | |
354 | -if (! function_exists('is_ajax_request')) { |
|
354 | +if (!function_exists('is_ajax_request')) { |
|
355 | 355 | /** |
356 | 356 | * Testez pour voir si une requête contient l'en-tête HTTP_X_REQUESTED_WITH. |
357 | 357 | */ |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | } |
362 | 362 | } |
363 | 363 | |
364 | -if (! function_exists('redirection')) { |
|
364 | +if (!function_exists('redirection')) { |
|
365 | 365 | /** |
366 | 366 | * Redirige l'utilisateur |
367 | 367 | */ |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | } |
376 | 376 | } |
377 | 377 | |
378 | -if (! function_exists('redirect')) { |
|
378 | +if (!function_exists('redirect')) { |
|
379 | 379 | /** |
380 | 380 | * Méthode pratique qui fonctionne avec la $request globale actuelle et |
381 | 381 | * l'instance $router à rediriger à l'aide de routes nommées et le routage inversé |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | { |
390 | 390 | $redirection = Services::redirection(); |
391 | 391 | |
392 | - if (! empty($uri)) { |
|
392 | + if (!empty($uri)) { |
|
393 | 393 | return $redirection->route($uri); |
394 | 394 | } |
395 | 395 | |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | } |
398 | 398 | } |
399 | 399 | |
400 | -if (! function_exists('link_to')) { |
|
400 | +if (!function_exists('link_to')) { |
|
401 | 401 | /** |
402 | 402 | * Étant donné une chaîne de contrôleur/méthode et tous les paramètres, |
403 | 403 | * tentera de créer l'URL relative à la route correspondante. |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | } |
418 | 418 | } |
419 | 419 | |
420 | -if (! function_exists('clean_path')) { |
|
420 | +if (!function_exists('clean_path')) { |
|
421 | 421 | /** |
422 | 422 | * Une méthode pratique pour nettoyer les chemins pour |
423 | 423 | * une sortie plus belle. Utile pour les exceptions |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | } |
450 | 450 | } |
451 | 451 | |
452 | -if (! function_exists('old')) { |
|
452 | +if (!function_exists('old')) { |
|
453 | 453 | /** |
454 | 454 | * Fournit l'accès à "entrée ancienne" qui a été définie dans la session lors d'un redirect()-withInput(). |
455 | 455 | * |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | function old(string $key, ?string $default = null, $escape = 'html') |
462 | 462 | { |
463 | 463 | // Assurez-vous de charger la session |
464 | - if (session_status() === PHP_SESSION_NONE && ! on_test()) { |
|
464 | + if (session_status() === PHP_SESSION_NONE && !on_test()) { |
|
465 | 465 | session(); // @codeCoverageIgnore |
466 | 466 | } |
467 | 467 | |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | |
477 | 477 | // ================================= FONCTIONS DE DEBOGAGE ================================= // |
478 | 478 | |
479 | -if (! function_exists('dd')) { |
|
479 | +if (!function_exists('dd')) { |
|
480 | 480 | /** |
481 | 481 | * Prints a Kint debug report and exits. |
482 | 482 | * |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | } |
496 | 496 | } |
497 | 497 | |
498 | -if (! function_exists('dump')) { |
|
498 | +if (!function_exists('dump')) { |
|
499 | 499 | /** |
500 | 500 | * Prints a Kint debug report and exits. |
501 | 501 | * |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | } |
513 | 513 | } |
514 | 514 | |
515 | -if (! function_exists('deprecationWarning')) { |
|
515 | +if (!function_exists('deprecationWarning')) { |
|
516 | 516 | /** |
517 | 517 | * Méthode d'assistance pour générer des avertissements d'obsolescence |
518 | 518 | * |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | } |
529 | 529 | } |
530 | 530 | |
531 | -if (! function_exists('logger')) { |
|
531 | +if (!function_exists('logger')) { |
|
532 | 532 | /** |
533 | 533 | * A convenience/compatibility method for logging events through |
534 | 534 | * the Log system. |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | { |
552 | 552 | $logger = Services::logger(); |
553 | 553 | |
554 | - if (! empty($level) && ! empty($message)) { |
|
554 | + if (!empty($level) && !empty($message)) { |
|
555 | 555 | return $logger->log($level, $message, $context); |
556 | 556 | } |
557 | 557 | |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | } |
560 | 560 | } |
561 | 561 | |
562 | -if (! function_exists('cache')) { |
|
562 | +if (!function_exists('cache')) { |
|
563 | 563 | /** |
564 | 564 | * Une méthode pratique qui donne accès au cache |
565 | 565 | * objet. Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | } |
590 | 590 | } |
591 | 591 | |
592 | -if (! function_exists('session')) { |
|
592 | +if (!function_exists('session')) { |
|
593 | 593 | /** |
594 | 594 | * Une méthode pratique pour accéder à l'instance de session, ou un élément qui a été défini dans la session. |
595 | 595 | * |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | } |
613 | 613 | } |
614 | 614 | |
615 | -if (! function_exists('pr')) { |
|
615 | +if (!function_exists('pr')) { |
|
616 | 616 | /** |
617 | 617 | * print_r() convenience function. |
618 | 618 | * |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | } |
635 | 635 | } |
636 | 636 | |
637 | -if (! function_exists('pj')) { |
|
637 | +if (!function_exists('pj')) { |
|
638 | 638 | /** |
639 | 639 | * json pretty print convenience function. |
640 | 640 | * |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | } |
656 | 656 | } |
657 | 657 | |
658 | -if (! function_exists('trigger_warning')) { |
|
658 | +if (!function_exists('trigger_warning')) { |
|
659 | 659 | /** |
660 | 660 | * Déclenche un E_USER_WARNING. |
661 | 661 | */ |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | } |
666 | 666 | } |
667 | 667 | |
668 | -if (! function_exists('vd')) { |
|
668 | +if (!function_exists('vd')) { |
|
669 | 669 | /** |
670 | 670 | * Shortcut to ref, HTML mode |
671 | 671 | * |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | } |
678 | 678 | } |
679 | 679 | |
680 | -if (! function_exists('vdt')) { |
|
680 | +if (!function_exists('vdt')) { |
|
681 | 681 | /** |
682 | 682 | * Shortcut to ref, plain text mode |
683 | 683 | * |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | |
692 | 692 | // ================================= FONCTIONS DIVERSES ================================= // |
693 | 693 | |
694 | -if (! function_exists('force_https')) { |
|
694 | +if (!function_exists('force_https')) { |
|
695 | 695 | /** |
696 | 696 | * Utilisé pour forcer l'accès à une page via HTTPS. |
697 | 697 | * Utilise une redirection standard, plus définira l'en-tête HSTS |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | } |
750 | 750 | } |
751 | 751 | |
752 | -if (! function_exists('getTypeName')) { |
|
752 | +if (!function_exists('getTypeName')) { |
|
753 | 753 | /** |
754 | 754 | * Renvoie la classe d'objets ou le type var de ce n'est pas un objet |
755 | 755 | * |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | } |
764 | 764 | } |
765 | 765 | |
766 | -if (! function_exists('ip_address')) { |
|
766 | +if (!function_exists('ip_address')) { |
|
767 | 767 | /** |
768 | 768 | * Renvoie l'adresse IP de l'utilisateur actuel |
769 | 769 | */ |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | } |
774 | 774 | } |
775 | 775 | |
776 | -if (! function_exists('is_really_writable')) { |
|
776 | +if (!function_exists('is_really_writable')) { |
|
777 | 777 | /** |
778 | 778 | * Tests d'inscriptibilité des fichiers |
779 | 779 | */ |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | } |
784 | 784 | } |
785 | 785 | |
786 | -if (! function_exists('lang')) { |
|
786 | +if (!function_exists('lang')) { |
|
787 | 787 | /** |
788 | 788 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
789 | 789 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | } |
795 | 795 | } |
796 | 796 | |
797 | -if (! function_exists('__')) { |
|
797 | +if (!function_exists('__')) { |
|
798 | 798 | /** |
799 | 799 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
800 | 800 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | } |
808 | 808 | } |
809 | 809 | |
810 | -if (! function_exists('namespace_split')) { |
|
810 | +if (!function_exists('namespace_split')) { |
|
811 | 811 | /** |
812 | 812 | * Séparez l'espace de noms du nom de classe. |
813 | 813 | * |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | } |
829 | 829 | } |
830 | 830 | |
831 | -if (! function_exists('view_exist')) { |
|
831 | +if (!function_exists('view_exist')) { |
|
832 | 832 | /** |
833 | 833 | * Verifie si un fichier de vue existe. Utile pour limiter les failles include |
834 | 834 | */ |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | } |
843 | 843 | } |
844 | 844 | |
845 | -if (! function_exists('view')) { |
|
845 | +if (!function_exists('view')) { |
|
846 | 846 | /** |
847 | 847 | * Charge une vue |
848 | 848 | * |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | } |
859 | 859 | } |
860 | 860 | |
861 | -if (! function_exists('flash')) { |
|
861 | +if (!function_exists('flash')) { |
|
862 | 862 | /** |
863 | 863 | * Fournisseur d'acces rapide a la classe PHP Flash |
864 | 864 | * |
@@ -890,7 +890,7 @@ discard block |
||
890 | 890 | }*/ |
891 | 891 | } |
892 | 892 | |
893 | -if (! function_exists('geo_ip')) { |
|
893 | +if (!function_exists('geo_ip')) { |
|
894 | 894 | /** |
895 | 895 | * Recuperation des coordonnees (pays, ville, etc) d'un utilisateur en fonction de son ip |
896 | 896 | */ |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | } |
901 | 901 | } |
902 | 902 | |
903 | -if (! function_exists('to_stream')) { |
|
903 | +if (!function_exists('to_stream')) { |
|
904 | 904 | /** |
905 | 905 | * Créez un nouveau flux basé sur le type d'entrée. |
906 | 906 | * |
@@ -923,7 +923,7 @@ discard block |
||
923 | 923 | } |
924 | 924 | } |
925 | 925 | |
926 | -if (! function_exists('value')) { |
|
926 | +if (!function_exists('value')) { |
|
927 | 927 | /** |
928 | 928 | * Renvoie la valeur par défaut de la valeur donnée. |
929 | 929 | */ |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | } |
934 | 934 | } |
935 | 935 | |
936 | -if (! function_exists('collect')) { |
|
936 | +if (!function_exists('collect')) { |
|
937 | 937 | /** |
938 | 938 | * Créez une collection à partir de la valeur donnée. |
939 | 939 | */ |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | } |
944 | 944 | } |
945 | 945 | |
946 | -if (! function_exists('with')) { |
|
946 | +if (!function_exists('with')) { |
|
947 | 947 | /** |
948 | 948 | * Renvoie la valeur donnée, éventuellement transmise via le rappel donné. |
949 | 949 | * |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | } |
956 | 956 | } |
957 | 957 | |
958 | -if (! function_exists('tap')) { |
|
958 | +if (!function_exists('tap')) { |
|
959 | 959 | /** |
960 | 960 | * Appelez la Closure donnée avec cette instance puis renvoyez l'instance. |
961 | 961 | */ |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | } |
966 | 966 | } |
967 | 967 | |
968 | -if (! function_exists('last')) { |
|
968 | +if (!function_exists('last')) { |
|
969 | 969 | /** |
970 | 970 | * Recupere le dernier element d'un tableau |
971 | 971 | */ |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | } |
976 | 976 | } |
977 | 977 | |
978 | -if (! function_exists('invade')) { |
|
978 | +if (!function_exists('invade')) { |
|
979 | 979 | /** |
980 | 980 | * Cette classe offre une fonction d'invasion qui vous permettra de lire / écrire des propriétés privées d'un objet. |
981 | 981 | * Il vous permettra également de définir, obtenir et appeler des méthodes privées. |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * the LICENSE file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -if (! function_exists('css_url')) { |
|
12 | +if (!function_exists('css_url')) { |
|
13 | 13 | /** |
14 | 14 | * CSS URL |
15 | 15 | * |
@@ -23,17 +23,17 @@ discard block |
||
23 | 23 | $name = str_replace(site_url() . 'css/', '', htmlspecialchars($name)); |
24 | 24 | |
25 | 25 | if (is_localfile($name)) { |
26 | - $name .= (! preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
26 | + $name .= (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
27 | 27 | $filename = WEBROOT . 'css' . DS . $name; |
28 | 28 | |
29 | 29 | return site_url() . 'css/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
30 | 30 | } |
31 | 31 | |
32 | - return $name . (! preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
32 | + return $name . (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | -if (! function_exists('js_url')) { |
|
36 | +if (!function_exists('js_url')) { |
|
37 | 37 | /** |
38 | 38 | * JS URL |
39 | 39 | * |
@@ -47,17 +47,17 @@ discard block |
||
47 | 47 | $name = str_replace(site_url() . 'js/', '', htmlspecialchars($name)); |
48 | 48 | |
49 | 49 | if (is_localfile($name)) { |
50 | - $name .= (! preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
50 | + $name .= (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
51 | 51 | $filename = WEBROOT . 'js' . DS . $name; |
52 | 52 | |
53 | 53 | return site_url() . 'js/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
54 | 54 | } |
55 | 55 | |
56 | - return $name . (! preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
56 | + return $name . (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | -if (! function_exists('lib_css_url')) { |
|
60 | +if (!function_exists('lib_css_url')) { |
|
61 | 61 | /** |
62 | 62 | * LIB CSS URL |
63 | 63 | * |
@@ -71,17 +71,17 @@ discard block |
||
71 | 71 | $name = str_replace(site_url() . 'lib/', '', htmlspecialchars($name)); |
72 | 72 | |
73 | 73 | if (is_localfile($name)) { |
74 | - $name .= (! preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
74 | + $name .= (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
75 | 75 | $filename = WEBROOT . 'lib' . DS . $name; |
76 | 76 | |
77 | 77 | return site_url() . 'lib/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
78 | 78 | } |
79 | 79 | |
80 | - return $name . (! preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
80 | + return $name . (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | -if (! function_exists('lib_js_url')) { |
|
84 | +if (!function_exists('lib_js_url')) { |
|
85 | 85 | /** |
86 | 86 | * LIB JS URL |
87 | 87 | * |
@@ -95,17 +95,17 @@ discard block |
||
95 | 95 | $name = str_replace(site_url() . 'lib/', '', htmlspecialchars($name)); |
96 | 96 | |
97 | 97 | if (is_localfile($name)) { |
98 | - $name .= (! preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
98 | + $name .= (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
99 | 99 | $filename = WEBROOT . 'lib' . DS . $name; |
100 | 100 | |
101 | 101 | return site_url() . 'lib/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
102 | 102 | } |
103 | 103 | |
104 | - return $name . (! preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
104 | + return $name . (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | -if (! function_exists('lib_styles')) { |
|
108 | +if (!function_exists('lib_styles')) { |
|
109 | 109 | /** |
110 | 110 | * LIB_STYLES |
111 | 111 | * |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | foreach ($name as $style) { |
125 | 125 | if (is_string($style)) { |
126 | - $style = (! preg_match('#\.css$#i', $style) ? $style . '.css' : $style); |
|
126 | + $style = (!preg_match('#\.css$#i', $style) ? $style . '.css' : $style); |
|
127 | 127 | if (is_file(WEBROOT . 'lib' . DS . str_replace('/', DS, $style))) { |
128 | 128 | $return[] = '<link rel="preload" type="text/css" href="' . lib_css_url($style) . '" as="style"> |
129 | 129 | <link rel="stylesheet" type="text/css" href="' . lib_css_url($style) . '" />'; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
150 | -if (! function_exists('lib_scripts')) { |
|
150 | +if (!function_exists('lib_scripts')) { |
|
151 | 151 | /** |
152 | 152 | * LIB_SCRIPTS |
153 | 153 | * |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | foreach ($name as $script) { |
167 | 167 | if (is_string($script)) { |
168 | - $script = (! preg_match('#\.js$#i', $script) ? $script . '.js' : $script); |
|
168 | + $script = (!preg_match('#\.js$#i', $script) ? $script . '.js' : $script); |
|
169 | 169 | if (is_file(WEBROOT . 'lib' . DS . str_replace('/', DS, $script))) { |
170 | 170 | $return[] = '<script type="text/javascript" src="' . lib_js_url($script) . '"></script>'; |
171 | 171 | } elseif (is_localfile($script)) { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | } |
189 | 189 | |
190 | -if (! function_exists('styles')) { |
|
190 | +if (!function_exists('styles')) { |
|
191 | 191 | /** |
192 | 192 | * STYLES |
193 | 193 | * |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | foreach ($name as $style) { |
207 | 207 | if (is_string($style)) { |
208 | - $style = (! preg_match('#\.css$#i', $style) ? $style . '.css' : $style); |
|
208 | + $style = (!preg_match('#\.css$#i', $style) ? $style . '.css' : $style); |
|
209 | 209 | if (is_file(WEBROOT . 'css' . DS . str_replace('/', DS, $style))) { |
210 | 210 | $return[] = '<link rel="preload" type="text/css" href="' . css_url($style) . '" as="style"> |
211 | 211 | <link rel="stylesheet" type="text/css" href="' . css_url($style) . '" />'; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | } |
231 | 231 | |
232 | -if (! function_exists('scripts')) { |
|
232 | +if (!function_exists('scripts')) { |
|
233 | 233 | /** |
234 | 234 | * SCRIPTS |
235 | 235 | * |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | foreach ($name as $script) { |
249 | 249 | if (is_string($script)) { |
250 | - $script = (! preg_match('#\.js$#i', $script) ? $script . '.js' : $script); |
|
250 | + $script = (!preg_match('#\.js$#i', $script) ? $script . '.js' : $script); |
|
251 | 251 | if (is_file(WEBROOT . 'js' . DS . str_replace('/', DS, $script))) { |
252 | 252 | $return[] = '<script type="text/javascript" src="' . js_url($script) . '"></script>'; |
253 | 253 | } elseif (is_localfile($script)) { |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | } |
270 | 270 | } |
271 | 271 | |
272 | -if (! function_exists('less_url')) { |
|
272 | +if (!function_exists('less_url')) { |
|
273 | 273 | /** |
274 | 274 | * LESS URL |
275 | 275 | * |
@@ -283,17 +283,17 @@ discard block |
||
283 | 283 | $name = str_replace(site_url() . 'less/', '', htmlspecialchars($name)); |
284 | 284 | |
285 | 285 | if (is_localfile($name)) { |
286 | - $name .= (! preg_match('#\.less$#i', $name) ? '.less' : ''); |
|
286 | + $name .= (!preg_match('#\.less$#i', $name) ? '.less' : ''); |
|
287 | 287 | $filename = WEBROOT . 'less' . DS . $name; |
288 | 288 | |
289 | 289 | return site_url() . 'less/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
290 | 290 | } |
291 | 291 | |
292 | - return $name . (! preg_match('#\.less$#i', $name) ? '.less' : ''); |
|
292 | + return $name . (!preg_match('#\.less$#i', $name) ? '.less' : ''); |
|
293 | 293 | } |
294 | 294 | } |
295 | 295 | |
296 | -if (! function_exists('less_styles')) { |
|
296 | +if (!function_exists('less_styles')) { |
|
297 | 297 | /** |
298 | 298 | * LESS_STYLES |
299 | 299 | * |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | |
312 | 312 | foreach ($name as $style) { |
313 | 313 | if (is_string($style)) { |
314 | - $style = (! preg_match('#\.less$#i', $style) ? $style . '.less' : $style); |
|
314 | + $style = (!preg_match('#\.less$#i', $style) ? $style . '.less' : $style); |
|
315 | 315 | if (is_file(WEBROOT . 'less' . DS . str_replace('/', DS, $style))) { |
316 | 316 | $return[] = '<link rel="stylesheet" type="text/less" href="' . less_url($style) . '" />'; |
317 | 317 | } elseif (is_localfile($style)) { |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | } |
334 | 334 | } |
335 | 335 | |
336 | -if (! function_exists('img_url')) { |
|
336 | +if (!function_exists('img_url')) { |
|
337 | 337 | /** |
338 | 338 | * IMG URL |
339 | 339 | * |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | } |
361 | 361 | } |
362 | 362 | |
363 | -if (! function_exists('img')) { |
|
363 | +if (!function_exists('img')) { |
|
364 | 364 | /** |
365 | 365 | * IMG |
366 | 366 | * |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | } |
392 | 392 | } |
393 | 393 | |
394 | -if (! function_exists('docs_url')) { |
|
394 | +if (!function_exists('docs_url')) { |
|
395 | 395 | /** |
396 | 396 | * DOCS URL |
397 | 397 | * |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | } |
419 | 419 | } |
420 | 420 | |
421 | -if (! function_exists('videos_url')) { |
|
421 | +if (!function_exists('videos_url')) { |
|
422 | 422 | /** |
423 | 423 | * VIDEOS URL |
424 | 424 | * |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | } |
446 | 446 | } |
447 | 447 | |
448 | -if (! function_exists('mix')) { |
|
448 | +if (!function_exists('mix')) { |
|
449 | 449 | /** |
450 | 450 | * Obtenez le chemin d'accès à un fichier Mix versionné. |
451 | 451 | * |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | if (!isset($manifest[$path])) { |
497 | 497 | $exception = new Exception("Impossible de localiser le fichier Mix: {$path}."); |
498 | 498 | |
499 | - if (! BLITZ_DEBUG) { |
|
499 | + if (!BLITZ_DEBUG) { |
|
500 | 500 | return $path; |
501 | 501 | } else { |
502 | 502 | throw $exception; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | - /** |
|
108 | + /** |
|
109 | 109 | * Charge un fichier d'aide en mémoire. |
110 | 110 | * Prend en charge les helpers d'espace de noms, à la fois dans et hors du répertoire 'helpers' d'un répertoire d'espace de noms. |
111 | 111 | */ |
@@ -115,53 +115,53 @@ discard block |
||
115 | 115 | |
116 | 116 | $loader = Services::locator(); |
117 | 117 | |
118 | - // Stockez nos versions de schame système et d'application afin que nous puissions contrôler l'ordre de chargement. |
|
119 | - $systemSchema = null; |
|
120 | - $appSchema = null; |
|
121 | - $vendorSchema = null; |
|
118 | + // Stockez nos versions de schame système et d'application afin que nous puissions contrôler l'ordre de chargement. |
|
119 | + $systemSchema = null; |
|
120 | + $appSchema = null; |
|
121 | + $vendorSchema = null; |
|
122 | 122 | |
123 | - // Le fichier de schema qui sera finalement utiliser |
|
124 | - $file = null; |
|
123 | + // Le fichier de schema qui sera finalement utiliser |
|
124 | + $file = null; |
|
125 | 125 | |
126 | - // Vérifiez si ce schama a déjà été chargé |
|
127 | - if (in_array($name, $loadedSchema, true)) { |
|
126 | + // Vérifiez si ce schama a déjà été chargé |
|
127 | + if (in_array($name, $loadedSchema, true)) { |
|
128 | 128 | return $loadedSchema[$name]; |
129 | - } |
|
130 | - |
|
131 | - // Si le fichier est dans un espace de noms, nous allons simplement saisir ce fichier et ne pas en rechercher d'autres |
|
132 | - if (strpos($name, '\\') !== false) { |
|
133 | - if (!empty($path = $loader->locateFile($name, 'schemas'))) { |
|
134 | - $file = $path; |
|
135 | - } |
|
136 | - } else { |
|
137 | - // Pas d'espaces de noms, donc recherchez dans tous les emplacements disponibles |
|
138 | - $paths = $loader->search('schemas/' . $name); |
|
139 | - |
|
140 | - foreach ($paths as $path) { |
|
141 | - if (strpos($path, CONFIG_PATH . 'schemas' . DS) === 0) { |
|
142 | - $appSchema = $path; |
|
143 | - } elseif (strpos($path, SYST_PATH . 'Constants' . DS . 'schemas' . DS) === 0) { |
|
144 | - $systemSchema = $path; |
|
145 | - } else { |
|
146 | - $vendorSchema = $path; |
|
147 | - } |
|
148 | - } |
|
149 | - |
|
150 | - // Les schema des vendor sont prioritaire, ensuite vienne ceux de l'application |
|
151 | - if (!empty($vendorSchema)) { |
|
152 | - $file = $vendorSchema; |
|
153 | - } else if (!empty($appSchema)) { |
|
154 | - $file = $appSchema; |
|
155 | - } else if (!empty($systemSchema)) { |
|
156 | - $file = $systemSchema; |
|
157 | - } |
|
158 | 129 | } |
159 | 130 | |
160 | - if (!empty($file)) { |
|
161 | - $schema = require($file); |
|
162 | - } else { |
|
163 | - $schema = null; |
|
164 | - } |
|
131 | + // Si le fichier est dans un espace de noms, nous allons simplement saisir ce fichier et ne pas en rechercher d'autres |
|
132 | + if (strpos($name, '\\') !== false) { |
|
133 | + if (!empty($path = $loader->locateFile($name, 'schemas'))) { |
|
134 | + $file = $path; |
|
135 | + } |
|
136 | + } else { |
|
137 | + // Pas d'espaces de noms, donc recherchez dans tous les emplacements disponibles |
|
138 | + $paths = $loader->search('schemas/' . $name); |
|
139 | + |
|
140 | + foreach ($paths as $path) { |
|
141 | + if (strpos($path, CONFIG_PATH . 'schemas' . DS) === 0) { |
|
142 | + $appSchema = $path; |
|
143 | + } elseif (strpos($path, SYST_PATH . 'Constants' . DS . 'schemas' . DS) === 0) { |
|
144 | + $systemSchema = $path; |
|
145 | + } else { |
|
146 | + $vendorSchema = $path; |
|
147 | + } |
|
148 | + } |
|
149 | + |
|
150 | + // Les schema des vendor sont prioritaire, ensuite vienne ceux de l'application |
|
151 | + if (!empty($vendorSchema)) { |
|
152 | + $file = $vendorSchema; |
|
153 | + } else if (!empty($appSchema)) { |
|
154 | + $file = $appSchema; |
|
155 | + } else if (!empty($systemSchema)) { |
|
156 | + $file = $systemSchema; |
|
157 | + } |
|
158 | + } |
|
159 | + |
|
160 | + if (!empty($file)) { |
|
161 | + $schema = require($file); |
|
162 | + } else { |
|
163 | + $schema = null; |
|
164 | + } |
|
165 | 165 | |
166 | 166 | if (empty($schema) || ! ($schema instanceof Schema)) { |
167 | 167 | $schema = Expect::mixed(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | $loader = Services::locator(); |
41 | 41 | |
42 | - if (! is_array($filenames)) { |
|
42 | + if (!is_array($filenames)) { |
|
43 | 43 | $filenames = [$filenames]; |
44 | 44 | } |
45 | 45 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | // Les helpers au niveau de l'application doivent remplacer tous les autres |
86 | - if (! empty($appHelper)) { |
|
86 | + if (!empty($appHelper)) { |
|
87 | 87 | $includes[] = $appHelper; |
88 | 88 | $loaded[] = $filename; |
89 | 89 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $includes = [...$includes, ...$localIncludes]; |
93 | 93 | |
94 | 94 | // Et celui par défaut du système doit être ajouté en dernier. |
95 | - if (! empty($systemHelper)) { |
|
95 | + if (!empty($systemHelper)) { |
|
96 | 96 | $includes[] = $systemHelper; |
97 | 97 | $loaded[] = $filename; |
98 | 98 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $schema = null; |
164 | 164 | } |
165 | 165 | |
166 | - if (empty($schema) || ! ($schema instanceof Schema)) { |
|
166 | + if (empty($schema) || !($schema instanceof Schema)) { |
|
167 | 167 | $schema = Expect::mixed(); |
168 | 168 | } |
169 | 169 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | throw LoadException::libraryNotFound($lib); |
204 | 204 | } |
205 | 205 | |
206 | - if (true !== $file_syst && ! class_exists($lib)) { |
|
206 | + if (true !== $file_syst && !class_exists($lib)) { |
|
207 | 207 | throw LoadException::libraryDontExist($lib); |
208 | 208 | } |
209 | 209 | |
@@ -221,16 +221,16 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public static function model(string $model, ?ConnectionInterface $connection = null) |
223 | 223 | { |
224 | - if (! class_exists($model) && ! Text::endsWith($model, 'Model')) { |
|
224 | + if (!class_exists($model) && !Text::endsWith($model, 'Model')) { |
|
225 | 225 | $model .= 'Model'; |
226 | 226 | } |
227 | 227 | |
228 | - if (! class_exists($model)) { |
|
228 | + if (!class_exists($model)) { |
|
229 | 229 | $model = str_replace(APP_NAMESPACE . '\\Models\\', '', $model); |
230 | 230 | $model = APP_NAMESPACE . '\\Models\\' . $model; |
231 | 231 | } |
232 | 232 | |
233 | - if (! class_exists($model)) { |
|
233 | + if (!class_exists($model)) { |
|
234 | 234 | throw LoadException::modelNotFound($model); |
235 | 235 | } |
236 | 236 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $controller = explode('/', $controller); |
249 | 249 | |
250 | 250 | $con = ucfirst(end($controller)); |
251 | - $con = (! preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con; |
|
251 | + $con = (!preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con; |
|
252 | 252 | $controller[count($controller) - 1] = $con; |
253 | 253 | |
254 | 254 | foreach ($controller as $key => &$value) { |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | |
260 | 260 | $path = CONTROLLER_PATH . Helpers::ensureExt(implode(DS, $controller), 'php'); |
261 | 261 | |
262 | - if (! file_exists($path)) { |
|
262 | + if (!file_exists($path)) { |
|
263 | 263 | throw LoadException::controllerNotFound(str_replace('Controller', '', $con), $path); |
264 | 264 | } |
265 | 265 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | if (class_exists($class_namespaced, false)) { |
271 | 271 | return Injector::make($class_namespaced); |
272 | 272 | } |
273 | - if (! class_exists($con, false)) { |
|
273 | + if (!class_exists($con, false)) { |
|
274 | 274 | throw LoadException::controllerDontExist(str_replace('Controller', '', $con), $path); |
275 | 275 | } |
276 | 276 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | protected static function verifyPreferApp(array $options, string $name): bool |
300 | 300 | { |
301 | 301 | // Tout element sans restriction passe |
302 | - if (! $options['preferApp']) { |
|
302 | + if (!$options['preferApp']) { |
|
303 | 303 | return true; |
304 | 304 | } |
305 | 305 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | // ================================= ================================= // |
26 | 26 | |
27 | -if (! function_exists('site_url')) { |
|
27 | +if (!function_exists('site_url')) { |
|
28 | 28 | /** |
29 | 29 | * Renvoie une URL de site telle que définie par la configuration de l'application. |
30 | 30 | * |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | -if (! function_exists('base_url')) { |
|
51 | +if (!function_exists('base_url')) { |
|
52 | 52 | /** |
53 | 53 | * Renvoie l'URL de base telle que définie par la configuration de l'application. |
54 | 54 | * Les URL de base sont des URL de site coupées sans la page d'index. |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | -if (! function_exists('current_url')) { |
|
70 | +if (!function_exists('current_url')) { |
|
71 | 71 | /** |
72 | 72 | * Renvoie l'URL complète (y compris les segments) de la page où cette fonction est placée |
73 | 73 | * |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
97 | -if (! function_exists('previous_url')) { |
|
97 | +if (!function_exists('previous_url')) { |
|
98 | 98 | /** |
99 | 99 | * Renvoie l'URL précédente sur laquelle se trouvait le visiteur actuel. Pour des raisons de sécurité |
100 | 100 | * nous vérifions d'abord une variable de session enregistrée, si elle existe, et l'utilisons. |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
122 | -if (! function_exists('uri_string')) { |
|
122 | +if (!function_exists('uri_string')) { |
|
123 | 123 | /** |
124 | 124 | * Renvoie la partie chemin de l'URL actuelle |
125 | 125 | * |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | -if (! function_exists('index_page')) { |
|
136 | +if (!function_exists('index_page')) { |
|
137 | 137 | /** |
138 | 138 | * Renvoie la "index_page" de votre fichier de configuration |
139 | 139 | */ |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | -if (! function_exists('anchor')) { |
|
146 | +if (!function_exists('anchor')) { |
|
147 | 147 | /** |
148 | 148 | * Crée une ancre basée sur l'URL locale. |
149 | 149 | * |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
171 | -if (! function_exists('anchor_popup')) { |
|
171 | +if (!function_exists('anchor_popup')) { |
|
172 | 172 | /** |
173 | 173 | * Lien d'ancrage - Version contextuelle |
174 | 174 | * |
@@ -191,12 +191,12 @@ discard block |
||
191 | 191 | return '<a href="' . $siteUrl . '" onclick="window.open(\'' . $siteUrl . "', '_blank'); return false;\">" . $title . '</a>'; |
192 | 192 | } |
193 | 193 | |
194 | - if (! is_array($attributes)) { |
|
194 | + if (!is_array($attributes)) { |
|
195 | 195 | $attributes = [$attributes]; |
196 | 196 | |
197 | 197 | // Ref: http://www.w3schools.com/jsref/met_win_open.asp |
198 | 198 | $windowName = '_blank'; |
199 | - } elseif (! empty($attributes['window_name'])) { |
|
199 | + } elseif (!empty($attributes['window_name'])) { |
|
200 | 200 | $windowName = $attributes['window_name']; |
201 | 201 | unset($attributes['window_name']); |
202 | 202 | } else { |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | } |
217 | 217 | } |
218 | 218 | |
219 | -if (! function_exists('mailto')) { |
|
219 | +if (!function_exists('mailto')) { |
|
220 | 220 | /** |
221 | 221 | * Lien Mailto |
222 | 222 | * |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | } |
235 | 235 | |
236 | -if (! function_exists('safe_mailto')) { |
|
236 | +if (!function_exists('safe_mailto')) { |
|
237 | 237 | /** |
238 | 238 | * Lien Mailto codé |
239 | 239 | * |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | } |
323 | 323 | } |
324 | 324 | |
325 | -if (! function_exists('auto_link')) { |
|
325 | +if (!function_exists('auto_link')) { |
|
326 | 326 | /** |
327 | 327 | * Lien automatique |
328 | 328 | * |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | function auto_link(string $str, string $type = 'both', bool $popup = false): string |
338 | 338 | { |
339 | 339 | // Recherche et remplace tous les URLs. |
340 | - if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { |
|
340 | + if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#i', $str, $matches, PREG_OFFSET_CAPTURE|PREG_SET_ORDER)) { |
|
341 | 341 | // Définissez notre HTML cible si vous utilisez des liens contextuels. |
342 | 342 | $target = ($popup) ? ' target="_blank"' : ''; |
343 | 343 | |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | } |
369 | 369 | } |
370 | 370 | |
371 | -if (! function_exists('prep_url')) { |
|
371 | +if (!function_exists('prep_url')) { |
|
372 | 372 | /** |
373 | 373 | * Ajoute simplement la partie http:// ou https:// si aucun schéma n'est inclus. |
374 | 374 | * |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | } |
394 | 394 | } |
395 | 395 | |
396 | -if (! function_exists('url_title')) { |
|
396 | +if (!function_exists('url_title')) { |
|
397 | 397 | /** |
398 | 398 | * Créer un titre d'URL |
399 | 399 | * |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | } |
430 | 430 | } |
431 | 431 | |
432 | -if (! function_exists('mb_url_title')) { |
|
432 | +if (!function_exists('mb_url_title')) { |
|
433 | 433 | /** |
434 | 434 | * Créer un titre d'URL qui prend en compte les caractères accentués |
435 | 435 | * |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | } |
449 | 449 | } |
450 | 450 | |
451 | -if (! function_exists('route')) { |
|
451 | +if (!function_exists('route')) { |
|
452 | 452 | /** |
453 | 453 | * Générez l'URL vers une route nommée. |
454 | 454 | * |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | } |
467 | 467 | } |
468 | 468 | |
469 | -if (! function_exists('url_to')) { |
|
469 | +if (!function_exists('url_to')) { |
|
470 | 470 | /** |
471 | 471 | * Obtenir l'URL complète et absolue d'une méthode de contrôleur |
472 | 472 | * (avec arguments supplémentaires) |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | */ |
480 | 480 | function url_to(string $controller, ...$args): string |
481 | 481 | { |
482 | - if (! $route = link_to($controller, ...$args)) { |
|
482 | + if (!$route = link_to($controller, ...$args)) { |
|
483 | 483 | $explode = explode('::', $controller); |
484 | 484 | |
485 | 485 | if (isset($explode[1])) { |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | } |
494 | 494 | } |
495 | 495 | |
496 | -if (! function_exists('url_is')) { |
|
496 | +if (!function_exists('url_is')) { |
|
497 | 497 | /** |
498 | 498 | * Détermine si le chemin d'URL actuel contient le chemin donné. |
499 | 499 | * Il peut contenir un caractère générique (*) qui autorisera tout caractère valide. |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | } |
512 | 512 | } |
513 | 513 | |
514 | -if (! function_exists('link_active')) { |
|
514 | +if (!function_exists('link_active')) { |
|
515 | 515 | /** |
516 | 516 | * Lien actif dans la navbar |
517 | 517 | * Un peut comme le router-active-link de vuejs |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | return $active_class; |
526 | 526 | } |
527 | 527 | |
528 | - if (! $exact && preg_match('#^' . $path . '/?#i', $current_section)) { |
|
528 | + if (!$exact && preg_match('#^' . $path . '/?#i', $current_section)) { |
|
529 | 529 | return $active_class; |
530 | 530 | } |
531 | 531 | |
@@ -537,14 +537,14 @@ discard block |
||
537 | 537 | } |
538 | 538 | } |
539 | 539 | |
540 | -if (! function_exists('clean_url')) { |
|
540 | +if (!function_exists('clean_url')) { |
|
541 | 541 | function clean_url(string $url): string |
542 | 542 | { |
543 | 543 | return Helpers::cleanUrl($url); |
544 | 544 | } |
545 | 545 | } |
546 | 546 | |
547 | -if (! function_exists('is_absolute_link')) { |
|
547 | +if (!function_exists('is_absolute_link')) { |
|
548 | 548 | /** |
549 | 549 | * Verifies si un chemin donnée est une url absolue ou relative |
550 | 550 | */ |
@@ -233,7 +233,7 @@ |
||
233 | 233 | $file = $this->locator->locateFile($view, 'Views', empty($ext) ? 'php' : $ext); |
234 | 234 | } |
235 | 235 | |
236 | - $file = realpath($file); |
|
236 | + $file = realpath($file); |
|
237 | 237 | |
238 | 238 | // locateFile renverra une chaîne vide si le fichier est introuvable. |
239 | 239 | if (! is_file($file)) { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | { |
71 | 71 | helper('assets'); |
72 | 72 | |
73 | - if (! empty($viewPathLocator)) { |
|
73 | + if (!empty($viewPathLocator)) { |
|
74 | 74 | if (is_string($viewPathLocator)) { |
75 | 75 | $this->viewPath = rtrim($viewPathLocator, '\\/ ') . DS; |
76 | 76 | } elseif ($viewPathLocator instanceof Locator) { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $options = (array) $options; |
222 | 222 | |
223 | 223 | $viewPath = $options['viewPath'] ?? $this->viewPath; |
224 | - if (! empty($viewPath)) { |
|
224 | + if (!empty($viewPath)) { |
|
225 | 225 | $file = str_replace('/', DS, rtrim($viewPath, '/\\') . DS . ltrim($view, '/\\')); |
226 | 226 | } else { |
227 | 227 | $file = $view; |
@@ -229,14 +229,14 @@ discard block |
||
229 | 229 | |
230 | 230 | $file = Helpers::ensureExt($file, $ext); |
231 | 231 | |
232 | - if (! is_file($file) && $this->locator instanceof Locator) { |
|
232 | + if (!is_file($file) && $this->locator instanceof Locator) { |
|
233 | 233 | $file = $this->locator->locateFile($view, 'Views', empty($ext) ? 'php' : $ext); |
234 | 234 | } |
235 | 235 | |
236 | 236 | $file = realpath($file); |
237 | 237 | |
238 | 238 | // locateFile renverra une chaîne vide si le fichier est introuvable. |
239 | - if (! is_file($file)) { |
|
239 | + if (!is_file($file)) { |
|
240 | 240 | throw ViewException::invalidFile($view); |
241 | 241 | } |
242 | 242 |