@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function set($key, $value, $ttl = null): bool |
89 | 89 | { |
90 | - if ($value === '' || ! $this->_init) { |
|
90 | + if ($value === '' || !$this->_init) { |
|
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | return false; |
98 | 98 | } |
99 | 99 | |
100 | - if (! empty($this->_config['serialize'])) { |
|
100 | + if (!empty($this->_config['serialize'])) { |
|
101 | 101 | $value = serialize($value); |
102 | 102 | } |
103 | 103 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | { |
131 | 131 | $key = $this->_key($key); |
132 | 132 | |
133 | - if (! $this->_init || $this->_setKey($key) === false) { |
|
133 | + if (!$this->_init || $this->_setKey($key) === false) { |
|
134 | 134 | return $default; |
135 | 135 | } |
136 | 136 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | $data = trim($data); |
169 | 169 | |
170 | - if ($data !== '' && ! empty($this->_config['serialize'])) { |
|
170 | + if ($data !== '' && !empty($this->_config['serialize'])) { |
|
171 | 171 | $data = unserialize($data); |
172 | 172 | } |
173 | 173 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | { |
182 | 182 | $key = $this->_key($key); |
183 | 183 | |
184 | - if ($this->_setKey($key) === false || ! $this->_init) { |
|
184 | + if ($this->_setKey($key) === false || !$this->_init) { |
|
185 | 185 | return false; |
186 | 186 | } |
187 | 187 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function clear(): bool |
205 | 205 | { |
206 | - if (! $this->_init) { |
|
206 | + if (!$this->_init) { |
|
207 | 207 | return false; |
208 | 208 | } |
209 | 209 | $this->_File = null; |
@@ -228,14 +228,14 @@ discard block |
||
228 | 228 | } |
229 | 229 | |
230 | 230 | $realPath = $fileInfo->getRealPath(); |
231 | - if (! $realPath) { |
|
231 | + if (!$realPath) { |
|
232 | 232 | unset($fileInfo); |
233 | 233 | |
234 | 234 | continue; |
235 | 235 | } |
236 | 236 | |
237 | 237 | $path = $realPath . DIRECTORY_SEPARATOR; |
238 | - if (! in_array($path, $cleared, true)) { |
|
238 | + if (!in_array($path, $cleared, true)) { |
|
239 | 239 | $this->_clearDirectory($path); |
240 | 240 | $cleared[] = $path; |
241 | 241 | } |
@@ -256,12 +256,12 @@ discard block |
||
256 | 256 | */ |
257 | 257 | protected function _clearDirectory(string $path): void |
258 | 258 | { |
259 | - if (! is_dir($path)) { |
|
259 | + if (!is_dir($path)) { |
|
260 | 260 | return; |
261 | 261 | } |
262 | 262 | |
263 | 263 | $dir = dir($path); |
264 | - if (! $dir) { |
|
264 | + if (!$dir) { |
|
265 | 265 | return; |
266 | 266 | } |
267 | 267 | |
@@ -327,13 +327,13 @@ discard block |
||
327 | 327 | } |
328 | 328 | $dir = $this->_config['path'] . $groups; |
329 | 329 | |
330 | - if (! is_dir($dir)) { |
|
330 | + if (!is_dir($dir)) { |
|
331 | 331 | mkdir($dir, 0775, true); |
332 | 332 | } |
333 | 333 | |
334 | 334 | $path = new SplFileInfo($dir . $key); |
335 | 335 | |
336 | - if (! $createKey && ! $path->isFile()) { |
|
336 | + if (!$createKey && !$path->isFile()) { |
|
337 | 337 | return false; |
338 | 338 | } |
339 | 339 | if ( |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | } |
353 | 353 | unset($path); |
354 | 354 | |
355 | - if (! $exists && ! chmod($this->_File->getPathname(), (int) $this->_config['mask'])) { |
|
355 | + if (!$exists && !chmod($this->_File->getPathname(), (int) $this->_config['mask'])) { |
|
356 | 356 | trigger_error(sprintf( |
357 | 357 | 'Could not apply permission mask "%s" on cache file "%s"', |
358 | 358 | $this->_File->getPathname(), |
@@ -372,14 +372,14 @@ discard block |
||
372 | 372 | $dir = new SplFileInfo($this->_config['path']); |
373 | 373 | $path = $dir->getPathname(); |
374 | 374 | $success = true; |
375 | - if (! is_dir($path)) { |
|
375 | + if (!is_dir($path)) { |
|
376 | 376 | // phpcs:disable |
377 | 377 | $success = @mkdir($path, 0775, true); |
378 | 378 | // phpcs:enable |
379 | 379 | } |
380 | 380 | |
381 | 381 | $isWritableDir = ($dir->isDir() && $dir->isWritable()); |
382 | - if (! $success || ($this->_init && ! $isWritableDir)) { |
|
382 | + if (!$success || ($this->_init && !$isWritableDir)) { |
|
383 | 383 | $this->_init = false; |
384 | 384 | trigger_error(sprintf( |
385 | 385 | '%s is not writable', |
@@ -423,8 +423,8 @@ discard block |
||
423 | 423 | ); |
424 | 424 | $filtered = new CallbackFilterIterator( |
425 | 425 | $contents, |
426 | - static function (SplFileInfo $current) use ($group, $prefix) { |
|
427 | - if (! $current->isFile()) { |
|
426 | + static function(SplFileInfo $current) use ($group, $prefix) { |
|
427 | + if (!$current->isFile()) { |
|
428 | 428 | return false; |
429 | 429 | } |
430 | 430 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | foreach ($paths as $path) { |
45 | 45 | if (file_exists($path)) { |
46 | - if (! in_array($path, get_included_files(), true)) { |
|
46 | + if (!in_array($path, get_included_files(), true)) { |
|
47 | 47 | $languages = array_merge($languages, (array) require($path)); |
48 | 48 | } |
49 | 49 | $file_exist = true; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | throw LoadException::libraryNotFound($lib); |
121 | 121 | } |
122 | 122 | |
123 | - if (true !== $file_syst && ! class_exists($lib)) { |
|
123 | + if (true !== $file_syst && !class_exists($lib)) { |
|
124 | 124 | throw LoadException::libraryDontExist($lib); |
125 | 125 | } |
126 | 126 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | 'preferApp' => true, |
143 | 143 | ], $options); |
144 | 144 | |
145 | - if (! preg_match('#Model$#', $model)) { |
|
145 | + if (!preg_match('#Model$#', $model)) { |
|
146 | 146 | $model .= 'Model'; |
147 | 147 | } |
148 | 148 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $model = APP_NAMESPACE . '\\Models\\' . $model; |
154 | 154 | } |
155 | 155 | |
156 | - if (! class_exists($model)) { |
|
156 | + if (!class_exists($model)) { |
|
157 | 157 | throw LoadException::modelNotFound($model); |
158 | 158 | } |
159 | 159 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $controller = explode('/', $controller); |
172 | 172 | |
173 | 173 | $con = ucfirst(end($controller)); |
174 | - $con = (! preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con; |
|
174 | + $con = (!preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con; |
|
175 | 175 | $controller[count($controller) - 1] = $con; |
176 | 176 | |
177 | 177 | foreach ($controller as $key => &$value) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | $path = CONTROLLER_PATH . Helpers::ensureExt(implode(DS, $controller), 'php'); |
184 | 184 | |
185 | - if (! file_exists($path)) { |
|
185 | + if (!file_exists($path)) { |
|
186 | 186 | throw LoadException::controllerNotFound(str_replace('Controller', '', $con), $path); |
187 | 187 | } |
188 | 188 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | if (class_exists($class_namespaced, false)) { |
194 | 194 | return Injector::make($class_namespaced); |
195 | 195 | } |
196 | - if (! class_exists($con, false)) { |
|
196 | + if (!class_exists($con, false)) { |
|
197 | 197 | throw LoadException::controllerDontExist(str_replace('Controller', '', $con), $path); |
198 | 198 | } |
199 | 199 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | protected static function verifyPreferApp(array $options, string $name): bool |
223 | 223 | { |
224 | 224 | // Tout element sans restriction passe |
225 | - if (! $options['preferApp']) { |
|
225 | + if (!$options['preferApp']) { |
|
226 | 226 | return true; |
227 | 227 | } |
228 | 228 |
@@ -39,16 +39,16 @@ discard block |
||
39 | 39 | |
40 | 40 | // services système |
41 | 41 | $filename = SYST_PATH . 'Constants' . DS . 'providers.php'; |
42 | - if (! file_exists($filename)) { |
|
42 | + if (!file_exists($filename)) { |
|
43 | 43 | throw LoadException::providersDefinitionDontExist($filename); |
44 | 44 | } |
45 | - if (! in_array($filename, get_included_files(), true)) { |
|
45 | + if (!in_array($filename, get_included_files(), true)) { |
|
46 | 46 | $providers = array_merge($providers, require $filename); |
47 | 47 | } |
48 | 48 | |
49 | 49 | // services de l'application |
50 | 50 | $filename = CONFIG_PATH . 'providers.php'; |
51 | - if (file_exists($filename) && ! in_array($filename, get_included_files(), true)) { |
|
51 | + if (file_exists($filename) && !in_array($filename, get_included_files(), true)) { |
|
52 | 52 | $providers = array_merge($providers, require $filename); |
53 | 53 | } |
54 | 54 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | return $models; |
98 | 98 | } |
99 | 99 | |
100 | - if (! self::isLoaded('models', $model)) { |
|
100 | + if (!self::isLoaded('models', $model)) { |
|
101 | 101 | self::loaded('models', $model, FileLocator::model($model, $options, $connection)); |
102 | 102 | } |
103 | 103 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $locale ??= config('app.language'); |
113 | 113 | |
114 | - if (! self::isLoaded('langs', $file . $locale)) { |
|
114 | + if (!self::isLoaded('langs', $file . $locale)) { |
|
115 | 115 | self::loaded('langs', $file . $locale, FileLocator::lang($file, $locale)); |
116 | 116 | } |
117 | 117 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | private static function isLoaded(string $module, $element): bool |
127 | 127 | { |
128 | - if (! isset(self::$loads[$module]) || ! is_array(self::$loads[$module])) { |
|
128 | + if (!isset(self::$loads[$module]) || !is_array(self::$loads[$module])) { |
|
129 | 129 | return false; |
130 | 130 | } |
131 | 131 |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | $this->getModel(); |
93 | 93 | |
94 | - if (! empty($this->helpers)) { |
|
94 | + if (!empty($this->helpers)) { |
|
95 | 95 | helper($this->helpers); |
96 | 96 | } |
97 | 97 | } |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | $this->modelName = is_object($which) ? null : $which; |
110 | 110 | } |
111 | 111 | |
112 | - if (empty($this->model) && ! empty($this->modelName) && class_exists($this->modelName)) { |
|
112 | + if (empty($this->model) && !empty($this->modelName) && class_exists($this->modelName)) { |
|
113 | 113 | $this->model = model($this->modelName); |
114 | 114 | } |
115 | 115 | |
116 | - if (! empty($this->model) && empty($this->modelName)) { |
|
116 | + if (!empty($this->model) && empty($this->modelName)) { |
|
117 | 117 | $this->modelName = get_class($this->model); |
118 | 118 | } |
119 | 119 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | private function getModel() |
153 | 153 | { |
154 | - if (! empty($this->modelName)) { |
|
154 | + if (!empty($this->modelName)) { |
|
155 | 155 | $model = $this->modelName; |
156 | 156 | } else { |
157 | 157 | $model = str_replace('Controller', 'Model', static::class); |
@@ -152,19 +152,19 @@ |
||
152 | 152 | */ |
153 | 153 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
154 | 154 | { |
155 | - if (! in_array($request->getMethod(), $this->methods, true)) { |
|
155 | + if (!in_array($request->getMethod(), $this->methods, true)) { |
|
156 | 156 | return $handler->handle($request); |
157 | 157 | } |
158 | 158 | |
159 | 159 | [$type] = explode(';', $request->getHeaderLine('Content-Type')); |
160 | 160 | $type = strtolower($type); |
161 | - if (! isset($this->parsers[$type])) { |
|
161 | + if (!isset($this->parsers[$type])) { |
|
162 | 162 | return $handler->handle($request); |
163 | 163 | } |
164 | 164 | |
165 | 165 | $parser = $this->parsers[$type]; |
166 | 166 | $result = $parser($request->getBody()->getContents()); |
167 | - if (! is_array($result)) { |
|
167 | + if (!is_array($result)) { |
|
168 | 168 | throw HttpException::badRequest(); |
169 | 169 | } |
170 | 170 | $request = $request->withParsedBody($result); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $controller = $routes->getDefaultController(); |
172 | 172 | } |
173 | 173 | |
174 | - if (! $fullName && is_string($controller)) { |
|
174 | + if (!$fullName && is_string($controller)) { |
|
175 | 175 | $controller = str_replace($routes->getDefaultNamespace(), '', $controller); |
176 | 176 | } |
177 | 177 | |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | require_once $routes_file; |
273 | 273 | } |
274 | 274 | } |
275 | - if (empty($routes) || ! ($routes instanceof RouteCollection)) { |
|
275 | + if (empty($routes) || !($routes instanceof RouteCollection)) { |
|
276 | 276 | $routes = Services::routes(); |
277 | 277 | } |
278 | 278 | |
@@ -282,14 +282,14 @@ discard block |
||
282 | 282 | $routeMiddlewares = (array) $this->dispatchRoutes($routes); |
283 | 283 | |
284 | 284 | // The bootstrapping in a middleware |
285 | - $this->middleware->append(function (ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface { |
|
285 | + $this->middleware->append(function(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface { |
|
286 | 286 | $returned = $this->startController($request, $response); |
287 | 287 | |
288 | 288 | // Closure controller has run in startController(). |
289 | - if (! is_callable($this->controller)) { |
|
289 | + if (!is_callable($this->controller)) { |
|
290 | 290 | $controller = $this->createController($request, $response); |
291 | 291 | |
292 | - if (! method_exists($controller, '_remap') && ! is_callable([$controller, $this->method], false)) { |
|
292 | + if (!method_exists($controller, '_remap') && !is_callable([$controller, $this->method], false)) { |
|
293 | 293 | throw PageNotFoundException::methodNotFound($this->method); |
294 | 294 | } |
295 | 295 | |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | */ |
328 | 328 | $this->gatherOutput($this->middleware->handle($this->request)); |
329 | 329 | |
330 | - if (! $returnResponse) { |
|
330 | + if (!$returnResponse) { |
|
331 | 331 | $this->sendResponse(); |
332 | 332 | } |
333 | 333 | |
@@ -375,14 +375,14 @@ discard block |
||
375 | 375 | return; |
376 | 376 | } |
377 | 377 | |
378 | - if (is_cli() && ! on_test()) { |
|
378 | + if (is_cli() && !on_test()) { |
|
379 | 379 | // @codeCoverageIgnoreStart |
380 | 380 | // $this->request = Services::clirequest($this->config); |
381 | 381 | // @codeCoverageIgnoreEnd |
382 | 382 | } |
383 | 383 | |
384 | 384 | $version = $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1'; |
385 | - if (! is_numeric($version)) { |
|
385 | + if (!is_numeric($version)) { |
|
386 | 386 | $version = substr($version, strpos($version, '/') + 1); |
387 | 387 | } |
388 | 388 | |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | // Supposons le succès jusqu'à preuve du contraire. |
402 | 402 | $this->response = Services::response()->withStatus(200); |
403 | 403 | |
404 | - if (! is_cli() || on_test()) { |
|
404 | + if (!is_cli() || on_test()) { |
|
405 | 405 | } |
406 | 406 | |
407 | 407 | $this->response = $this->response->withProtocolVersion($this->request->getProtocolVersion()); |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | { |
438 | 438 | if ($cachedResponse = Services::cache()->read($this->generateCacheName())) { |
439 | 439 | $cachedResponse = unserialize($cachedResponse); |
440 | - if (! is_array($cachedResponse) || ! isset($cachedResponse['output']) || ! isset($cachedResponse['headers'])) { |
|
440 | + if (!is_array($cachedResponse) || !isset($cachedResponse['output']) || !isset($cachedResponse['headers'])) { |
|
441 | 441 | throw new FrameworkException('Error unserializing page cache'); |
442 | 442 | } |
443 | 443 | |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | */ |
567 | 567 | protected function determinePath(): string |
568 | 568 | { |
569 | - if (! empty($this->path)) { |
|
569 | + if (!empty($this->path)) { |
|
570 | 570 | return $this->path; |
571 | 571 | } |
572 | 572 | |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | } |
619 | 619 | |
620 | 620 | // Essayez de charger automatiquement la classe |
621 | - if (! class_exists($this->controller, true) || $this->method[0] === '_') { |
|
621 | + if (!class_exists($this->controller, true) || $this->method[0] === '_') { |
|
622 | 622 | throw PageNotFoundException::controllerNotFound($this->controller, $this->method); |
623 | 623 | } |
624 | 624 | |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | // Affiche l'erreur 404 |
707 | 707 | $this->response = $this->response->withStatus($e->getCode()); |
708 | 708 | |
709 | - if (! on_test()) { |
|
709 | + if (!on_test()) { |
|
710 | 710 | // @codeCoverageIgnoreStart |
711 | 711 | if (ob_get_level() > 0) { |
712 | 712 | ob_end_flush(); |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | ob_end_flush(); // @codeCoverageIgnore |
719 | 719 | } |
720 | 720 | |
721 | - throw PageNotFoundException::pageNotFound(! on_prod() || is_cli() ? $e->getMessage() : ''); |
|
721 | + throw PageNotFoundException::pageNotFound(!on_prod() || is_cli() ? $e->getMessage() : ''); |
|
722 | 722 | } |
723 | 723 | |
724 | 724 | /** |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | public function storePreviousURL($uri) |
774 | 774 | { |
775 | 775 | // Ignorer les requêtes CLI |
776 | - if (is_cli() && ! on_test()) { |
|
776 | + if (is_cli() && !on_test()) { |
|
777 | 777 | return; // @codeCoverageIgnore |
778 | 778 | } |
779 | 779 | |
@@ -837,7 +837,7 @@ discard block |
||
837 | 837 | $this->middleware->prepend($this->spoofRequestMethod()); |
838 | 838 | |
839 | 839 | $middlewaresFile = CONFIG_PATH . 'middlewares.php'; |
840 | - if (file_exists($middlewaresFile) && ! in_array($middlewaresFile, get_included_files(), true)) { |
|
840 | + if (file_exists($middlewaresFile) && !in_array($middlewaresFile, get_included_files(), true)) { |
|
841 | 841 | $middleware = require $middlewaresFile; |
842 | 842 | if (is_callable($middleware)) { |
843 | 843 | $middlewareQueue = $middleware($this->middleware, $this->request); |
@@ -854,11 +854,11 @@ discard block |
||
854 | 854 | */ |
855 | 855 | private function spoofRequestMethod(): callable |
856 | 856 | { |
857 | - return static function (ServerRequestInterface $request, ResponseInterface $response, callable $next) { |
|
857 | + return static function(ServerRequestInterface $request, ResponseInterface $response, callable $next) { |
|
858 | 858 | $post = $request->getParsedBody(); |
859 | 859 | |
860 | 860 | // Ne fonctionne qu'avec les formulaires POST |
861 | - if (strtoupper($request->getMethod()) === 'POST' && ! empty($post['_method'])) { |
|
861 | + if (strtoupper($request->getMethod()) === 'POST' && !empty($post['_method'])) { |
|
862 | 862 | // Accepte seulement PUT, PATCH, DELETE |
863 | 863 | if (in_array(strtoupper($post['_method']), ['PUT', 'PATCH', 'DELETE'], true)) { |
864 | 864 | $request = $request->withMethod($post['_method']); |
@@ -63,12 +63,12 @@ |
||
63 | 63 | $group = on_test() ? 'test' : (on_prod() ? 'production' : 'development'); |
64 | 64 | } |
65 | 65 | |
66 | - if (! isset($config[$group])) { |
|
66 | + if (!isset($config[$group])) { |
|
67 | 67 | $group = 'default'; |
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | - if (is_string($group) && ! isset($config[$group]) && strpos($group, 'custom-') !== 0) { |
|
71 | + if (is_string($group) && !isset($config[$group]) && strpos($group, 'custom-') !== 0) { |
|
72 | 72 | throw new InvalidArgumentException($group . ' is not a valid database connection group.'); |
73 | 73 | } |
74 | 74 |
@@ -197,7 +197,7 @@ |
||
197 | 197 | $table = empty($table) ? $this->table : $table; |
198 | 198 | |
199 | 199 | // S'assurer qu'on a une bonne connxion a la base de donnees |
200 | - if (! $this->db instanceof ConnectionInterface) { |
|
200 | + if (!$this->db instanceof ConnectionInterface) { |
|
201 | 201 | $this->db = Database::connect($this->group); |
202 | 202 | } |
203 | 203 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | // ================================= FONCTIONS D'ACCESSIBILITE ================================= // |
24 | 24 | |
25 | -if (! function_exists('env')) { |
|
25 | +if (!function_exists('env')) { |
|
26 | 26 | /** |
27 | 27 | * Obtient une variable d'environnement à partir des sources disponibles et fournit une émulation |
28 | 28 | * pour les variables d'environnement non prises en charge ou incohérentes |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
41 | -if (! function_exists('helper')) { |
|
41 | +if (!function_exists('helper')) { |
|
42 | 42 | /** |
43 | 43 | * Charge un fichier d'aide en mémoire. Prend en charge les assistants d'espace de noms, |
44 | 44 | * à la fois dans et hors du répertoire 'helpers' d'un répertoire à espace de noms. |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | -if (! function_exists('model')) { |
|
59 | +if (!function_exists('model')) { |
|
60 | 60 | /** |
61 | 61 | * Simple maniere d'obtenir un modele. |
62 | 62 | * |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @return T |
68 | 68 | */ |
69 | - function model(string|array $name, array $options = [], ?ConnectionInterface &$conn = null) |
|
69 | + function model(string|array $name, array $options = [], ?ConnectionInterface&$conn = null) |
|
70 | 70 | { |
71 | 71 | return Load::model($name, $options, $conn); |
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | -if (! function_exists('service')) { |
|
75 | +if (!function_exists('service')) { |
|
76 | 76 | /** |
77 | 77 | * Permet un accès plus propre au fichier de configuration des services. |
78 | 78 | * Renvoie toujours une instance SHARED de la classe, donc |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | -if (! function_exists('single_service')) { |
|
92 | +if (!function_exists('single_service')) { |
|
93 | 93 | /** |
94 | 94 | * Autoriser l'accès propre à un service. |
95 | 95 | * Renvoie toujours une nouvelle instance de la classe. |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
106 | -if (! function_exists('show404')) { |
|
106 | +if (!function_exists('show404')) { |
|
107 | 107 | /** |
108 | 108 | * Afficher une page 404 introuvable dans le navigateur |
109 | 109 | */ |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | -if (! function_exists('config')) { |
|
116 | +if (!function_exists('config')) { |
|
117 | 117 | /** |
118 | 118 | * GET/SET App config |
119 | 119 | * |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | function config(string $config, $value = null, bool $force_set = false) |
125 | 125 | { |
126 | - if (! empty($value) || (empty($value) && true === $force_set)) { |
|
126 | + if (!empty($value) || (empty($value) && true === $force_set)) { |
|
127 | 127 | Config::set($config, $value); |
128 | 128 | } |
129 | 129 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | // =========================== FONCTIONS DE PREVENTION D'ATTAQUE =========================== // |
135 | 135 | |
136 | -if (! function_exists('esc')) { |
|
136 | +if (!function_exists('esc')) { |
|
137 | 137 | /** |
138 | 138 | * Effectue un simple échappement automatique des données pour des raisons de sécurité. |
139 | 139 | * Pourrait envisager de rendre cela plus complexe à une date ultérieure. |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
163 | -if (! function_exists('h')) { |
|
163 | +if (!function_exists('h')) { |
|
164 | 164 | /** |
165 | 165 | * Méthode pratique pour htmlspecialchars. |
166 | 166 | * |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | } |
181 | 181 | |
182 | -if (! function_exists('purify')) { |
|
182 | +if (!function_exists('purify')) { |
|
183 | 183 | /** |
184 | 184 | * Purifiez l'entrée à l'aide de la classe autonome HTMLPurifier. |
185 | 185 | * Utilisez facilement plusieurs configurations de purificateur. |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
200 | -if (! function_exists('remove_invisible_characters')) { |
|
200 | +if (!function_exists('remove_invisible_characters')) { |
|
201 | 201 | /** |
202 | 202 | * Supprimer les caractères invisibles |
203 | 203 | * |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
213 | -if (! function_exists('stringify_attributes')) { |
|
213 | +if (!function_exists('stringify_attributes')) { |
|
214 | 214 | /** |
215 | 215 | * Chaîner les attributs à utiliser dans les balises HTML. |
216 | 216 | * |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | |
225 | 225 | // ================================= FONCTIONS D'ENVIRONNEMENT D'EXECUTION ================================= // |
226 | 226 | |
227 | -if (! function_exists('on_dev')) { |
|
227 | +if (!function_exists('on_dev')) { |
|
228 | 228 | /** |
229 | 229 | * Testez pour voir si nous sommes dans un environnement de développement. |
230 | 230 | */ |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
243 | -if (! function_exists('on_prod')) { |
|
243 | +if (!function_exists('on_prod')) { |
|
244 | 244 | /** |
245 | 245 | * Testez pour voir si nous sommes dans un environnement de production. |
246 | 246 | */ |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | } |
258 | 258 | |
259 | -if (! function_exists('on_test')) { |
|
259 | +if (!function_exists('on_test')) { |
|
260 | 260 | /** |
261 | 261 | * Testez pour voir si nous sommes dans un environnement de test |
262 | 262 | */ |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | } |
269 | 269 | } |
270 | 270 | |
271 | -if (! function_exists('is_cli')) { |
|
271 | +if (!function_exists('is_cli')) { |
|
272 | 272 | /** |
273 | 273 | * Testez pour voir si une demande a été faite à partir de la ligne de commande. |
274 | 274 | */ |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | } |
280 | 280 | |
281 | -if (! function_exists('is_php')) { |
|
281 | +if (!function_exists('is_php')) { |
|
282 | 282 | /** |
283 | 283 | * Détermine si la version actuelle de PHP est égale ou supérieure à la valeur fournie. |
284 | 284 | */ |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | } |
289 | 289 | } |
290 | 290 | |
291 | -if (! function_exists('is_windows')) { |
|
291 | +if (!function_exists('is_windows')) { |
|
292 | 292 | /** |
293 | 293 | * Déterminez si l'environnement actuel est basé sur Windows. |
294 | 294 | */ |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | } |
299 | 299 | } |
300 | 300 | |
301 | -if (! function_exists('is_https')) { |
|
301 | +if (!function_exists('is_https')) { |
|
302 | 302 | /** |
303 | 303 | * Determines if the application is accessed via an encrypted * (HTTPS) connection. |
304 | 304 | */ |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | } |
310 | 310 | |
311 | -if (! function_exists('is_localfile')) { |
|
311 | +if (!function_exists('is_localfile')) { |
|
312 | 312 | /** |
313 | 313 | * Vérifiez si le fichier auquel vous souhaitez accéder est un fichier local de votre application ou non |
314 | 314 | */ |
@@ -318,11 +318,11 @@ discard block |
||
318 | 318 | return true; |
319 | 319 | } |
320 | 320 | |
321 | - return ! preg_match('#^(https?://)#i', $name); |
|
321 | + return !preg_match('#^(https?://)#i', $name); |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | |
325 | -if (! function_exists('is_online')) { |
|
325 | +if (!function_exists('is_online')) { |
|
326 | 326 | /** |
327 | 327 | * Tester si l'application s'exécute en local ou en ligne. |
328 | 328 | */ |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | } |
333 | 333 | } |
334 | 334 | |
335 | -if (! function_exists('is_ajax_request')) { |
|
335 | +if (!function_exists('is_ajax_request')) { |
|
336 | 336 | /** |
337 | 337 | * Testez pour voir si une requête contient l'en-tête HTTP_X_REQUESTED_WITH. |
338 | 338 | */ |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | } |
343 | 343 | } |
344 | 344 | |
345 | -if (! function_exists('redirection')) { |
|
345 | +if (!function_exists('redirection')) { |
|
346 | 346 | /** |
347 | 347 | * Redirige l'utilisateur |
348 | 348 | */ |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | } |
357 | 357 | } |
358 | 358 | |
359 | -if (! function_exists('redirect')) { |
|
359 | +if (!function_exists('redirect')) { |
|
360 | 360 | /** |
361 | 361 | * Méthode pratique qui fonctionne avec la $request globale actuelle et |
362 | 362 | * l'instance $router à rediriger à l'aide de routes nommées et le routage inversé |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | { |
371 | 371 | $redirection = Services::redirection(); |
372 | 372 | |
373 | - if (! empty($uri)) { |
|
373 | + if (!empty($uri)) { |
|
374 | 374 | return $redirection->route($uri); |
375 | 375 | } |
376 | 376 | |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | } |
379 | 379 | } |
380 | 380 | |
381 | -if (! function_exists('link_to')) { |
|
381 | +if (!function_exists('link_to')) { |
|
382 | 382 | /** |
383 | 383 | * Étant donné une chaîne de contrôleur/méthode et tous les paramètres, |
384 | 384 | * tentera de créer l'URL relative à la route correspondante. |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | } |
395 | 395 | } |
396 | 396 | |
397 | -if (! function_exists('clean_path')) { |
|
397 | +if (!function_exists('clean_path')) { |
|
398 | 398 | /** |
399 | 399 | * Une méthode pratique pour nettoyer les chemins pour |
400 | 400 | * une sortie plus belle. Utile pour les exceptions |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | |
426 | 426 | // ================================= FONCTIONS DE DEBOGAGE ================================= // |
427 | 427 | |
428 | -if (! function_exists('dd')) { |
|
428 | +if (!function_exists('dd')) { |
|
429 | 429 | /** |
430 | 430 | * Prints a Kint debug report and exits. |
431 | 431 | * |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | } |
445 | 445 | } |
446 | 446 | |
447 | -if (! function_exists('dump')) { |
|
447 | +if (!function_exists('dump')) { |
|
448 | 448 | /** |
449 | 449 | * Prints a Kint debug report and exits. |
450 | 450 | * |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | } |
462 | 462 | } |
463 | 463 | |
464 | -if (! function_exists('deprecationWarning')) { |
|
464 | +if (!function_exists('deprecationWarning')) { |
|
465 | 465 | /** |
466 | 466 | * Méthode d'assistance pour générer des avertissements d'obsolescence |
467 | 467 | * |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | } |
478 | 478 | } |
479 | 479 | |
480 | -if (! function_exists('logger')) { |
|
480 | +if (!function_exists('logger')) { |
|
481 | 481 | /** |
482 | 482 | * A convenience/compatibility method for logging events through |
483 | 483 | * the Log system. |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | { |
501 | 501 | $logger = Services::logger(); |
502 | 502 | |
503 | - if (! empty($level) && ! empty($message)) { |
|
503 | + if (!empty($level) && !empty($message)) { |
|
504 | 504 | return $logger->log($level, $message, $context); |
505 | 505 | } |
506 | 506 | |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | } |
509 | 509 | } |
510 | 510 | |
511 | -if (! function_exists('cache')) { |
|
511 | +if (!function_exists('cache')) { |
|
512 | 512 | /** |
513 | 513 | * Une méthode pratique qui donne accès au cache |
514 | 514 | * objet. Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | } |
539 | 539 | } |
540 | 540 | |
541 | -if (! function_exists('pr')) { |
|
541 | +if (!function_exists('pr')) { |
|
542 | 542 | /** |
543 | 543 | * print_r() convenience function. |
544 | 544 | * |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | } |
561 | 561 | } |
562 | 562 | |
563 | -if (! function_exists('pj')) { |
|
563 | +if (!function_exists('pj')) { |
|
564 | 564 | /** |
565 | 565 | * json pretty print convenience function. |
566 | 566 | * |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | } |
582 | 582 | } |
583 | 583 | |
584 | -if (! function_exists('trigger_warning')) { |
|
584 | +if (!function_exists('trigger_warning')) { |
|
585 | 585 | /** |
586 | 586 | * Déclenche un E_USER_WARNING. |
587 | 587 | */ |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | } |
592 | 592 | } |
593 | 593 | |
594 | -if (! function_exists('vd')) { |
|
594 | +if (!function_exists('vd')) { |
|
595 | 595 | /** |
596 | 596 | * Shortcut to ref, HTML mode |
597 | 597 | * |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | } |
604 | 604 | } |
605 | 605 | |
606 | -if (! function_exists('vdt')) { |
|
606 | +if (!function_exists('vdt')) { |
|
607 | 607 | /** |
608 | 608 | * Shortcut to ref, plain text mode |
609 | 609 | * |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | |
618 | 618 | // ================================= FONCTIONS DIVERSES ================================= // |
619 | 619 | |
620 | -if (! function_exists('force_https')) { |
|
620 | +if (!function_exists('force_https')) { |
|
621 | 621 | /** |
622 | 622 | * Utilisé pour forcer l'accès à une page via HTTPS. |
623 | 623 | * Utilise une redirection standard, plus définira l'en-tête HSTS |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | } |
676 | 676 | } |
677 | 677 | |
678 | -if (! function_exists('getTypeName')) { |
|
678 | +if (!function_exists('getTypeName')) { |
|
679 | 679 | /** |
680 | 680 | * Renvoie la classe d'objets ou le type var de ce n'est pas un objet |
681 | 681 | * |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | } |
690 | 690 | } |
691 | 691 | |
692 | -if (! function_exists('ip_address')) { |
|
692 | +if (!function_exists('ip_address')) { |
|
693 | 693 | /** |
694 | 694 | * Renvoie l'adresse IP de l'utilisateur actuel |
695 | 695 | */ |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | } |
700 | 700 | } |
701 | 701 | |
702 | -if (! function_exists('is_really_writable')) { |
|
702 | +if (!function_exists('is_really_writable')) { |
|
703 | 703 | /** |
704 | 704 | * Tests d'inscriptibilité des fichiers |
705 | 705 | */ |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | } |
711 | 711 | } |
712 | 712 | |
713 | -if (! function_exists('lang')) { |
|
713 | +if (!function_exists('lang')) { |
|
714 | 714 | /** |
715 | 715 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
716 | 716 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | } |
727 | 727 | } |
728 | 728 | |
729 | -if (! function_exists('namespaceSplit')) { |
|
729 | +if (!function_exists('namespaceSplit')) { |
|
730 | 730 | /** |
731 | 731 | * Séparez l'espace de noms du nom de classe. |
732 | 732 | * |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | } |
748 | 748 | } |
749 | 749 | |
750 | -if (! function_exists('view_exist')) { |
|
750 | +if (!function_exists('view_exist')) { |
|
751 | 751 | /** |
752 | 752 | * Verifie si un fichier de vue existe. Utile pour limiter les failles include |
753 | 753 | */ |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | } |
762 | 762 | } |
763 | 763 | |
764 | -if (! function_exists('view')) { |
|
764 | +if (!function_exists('view')) { |
|
765 | 765 | /** |
766 | 766 | * Charge une vue |
767 | 767 | * |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | } |
778 | 778 | } |
779 | 779 | |
780 | -if (! function_exists('flash')) { |
|
780 | +if (!function_exists('flash')) { |
|
781 | 781 | /** |
782 | 782 | * Fournisseur d'acces rapide a la classe PHP Flash |
783 | 783 | * |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | }*/ |
810 | 810 | } |
811 | 811 | |
812 | -if (! function_exists('geo_ip')) { |
|
812 | +if (!function_exists('geo_ip')) { |
|
813 | 813 | /** |
814 | 814 | * Recuperation des coordonnees (pays, ville, etc) d'un utilisateur en fonction de son ip |
815 | 815 | */ |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | } |
820 | 820 | } |
821 | 821 | |
822 | -if (! function_exists('to_stream')) { |
|
822 | +if (!function_exists('to_stream')) { |
|
823 | 823 | /** |
824 | 824 | * Créez un nouveau flux basé sur le type d'entrée. |
825 | 825 | * |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | } |
843 | 843 | } |
844 | 844 | |
845 | -if (! function_exists('value')) { |
|
845 | +if (!function_exists('value')) { |
|
846 | 846 | /** |
847 | 847 | * Renvoie la valeur par défaut de la valeur donnée. |
848 | 848 | * |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | } |
857 | 857 | } |
858 | 858 | |
859 | -if (! function_exists('with')) { |
|
859 | +if (!function_exists('with')) { |
|
860 | 860 | /** |
861 | 861 | * Renvoie la valeur donnée, éventuellement transmise via le rappel donné. |
862 | 862 | * |