@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $this->config = (object) config('rest'); |
| 73 | 73 | |
| 74 | 74 | $locale = $this->config->language ?? null; |
| 75 | - $this->locale = ! empty($locale) ? $locale : $this->request->getLocale(); |
|
| 75 | + $this->locale = !empty($locale) ? $locale : $this->request->getLocale(); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | public function _remap(string $method, array $params = []) |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $class = static::class; |
| 81 | 81 | |
| 82 | 82 | // Bien sûr qu'il existe, mais peuvent-ils en faire quelque chose ? |
| 83 | - if (! method_exists($class, $method)) { |
|
| 83 | + if (!method_exists($class, $method)) { |
|
| 84 | 84 | return $this->respondNotImplemented($this->_translate('notImplemented', [$class, $method])); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | return Services::injector()->call([$instance, $method], (array) $params); |
| 103 | 103 | } catch (Throwable $ex) { |
| 104 | - if (! on_dev()) { |
|
| 104 | + if (!on_dev()) { |
|
| 105 | 105 | $url = explode('?', $this->request->getRequestTarget())[0]; |
| 106 | 106 | |
| 107 | 107 | return $this->respondBadRequest($this->_translate('badUsed', [$url])); |
@@ -150,18 +150,18 @@ discard block |
||
| 150 | 150 | final protected function respondFail(?string $message = "Une erreur s'est produite", ?int $status = StatusCode::INTERNAL_ERROR, int|string|null $code = null, array $errors = []) |
| 151 | 151 | { |
| 152 | 152 | $message = $message ?: "Une erreur s'est produite"; |
| 153 | - $code = ! empty($code) ? $code : $status; |
|
| 153 | + $code = !empty($code) ? $code : $status; |
|
| 154 | 154 | |
| 155 | 155 | $response = [ |
| 156 | 156 | $this->config->field['message'] ?? 'message' => $message, |
| 157 | 157 | ]; |
| 158 | - if (! empty($this->config->field['status'])) { |
|
| 158 | + if (!empty($this->config->field['status'])) { |
|
| 159 | 159 | $response[$this->config->field['status']] = false; |
| 160 | 160 | } |
| 161 | - if (! empty($this->config->field['code'])) { |
|
| 161 | + if (!empty($this->config->field['code'])) { |
|
| 162 | 162 | $response[$this->config->field['code']] = $code; |
| 163 | 163 | } |
| 164 | - if (! empty($errors)) { |
|
| 164 | + if (!empty($errors)) { |
|
| 165 | 165 | $response[$this->config->field['errors'] ?? 'errors'] = $errors; |
| 166 | 166 | } |
| 167 | 167 | |
@@ -182,12 +182,12 @@ discard block |
||
| 182 | 182 | final protected function respondSuccess(?string $message = 'Resultat', $result = null, ?int $status = StatusCode::OK) |
| 183 | 183 | { |
| 184 | 184 | $message = $message ?: 'Resultat'; |
| 185 | - $status = ! empty($status) ? $status : StatusCode::OK; |
|
| 185 | + $status = !empty($status) ? $status : StatusCode::OK; |
|
| 186 | 186 | |
| 187 | 187 | $response = [ |
| 188 | 188 | $this->config->field['message'] ?? 'message' => $message, |
| 189 | 189 | ]; |
| 190 | - if (! empty($this->config->field['status'])) { |
|
| 190 | + if (!empty($this->config->field['status'])) { |
|
| 191 | 191 | $response[$this->config->field['status']] = true; |
| 192 | 192 | } |
| 193 | 193 | if (is_array($result)) { |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | final protected function allowedMethods(string ...$methods): self |
| 301 | 301 | { |
| 302 | - if (! empty($methods)) { |
|
| 302 | + if (!empty($methods)) { |
|
| 303 | 303 | $this->config->allowed_methods = array_map(static fn ($str) => strtoupper($str), $methods); |
| 304 | 304 | } |
| 305 | 305 | |
@@ -397,13 +397,13 @@ discard block |
||
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | // Si la méthode de format existe, appelle et renvoie la sortie dans ce format |
| 400 | - if (! empty($mime)) { |
|
| 400 | + if (!empty($mime)) { |
|
| 401 | 401 | $output = Formatter::type($mime)->format($data); |
| 402 | 402 | |
| 403 | 403 | // Définit l'en-tête du format |
| 404 | 404 | // Ensuite, vérifiez si le client a demandé un rappel, et si la sortie contient ce rappel : |
| 405 | 405 | $callback = $this->request->getQuery('callback'); |
| 406 | - if (! empty($callback) && $mime === $this->mimes['json'] && preg_match('/^' . $callback . '/', $output)) { |
|
| 406 | + if (!empty($callback) && $mime === $this->mimes['json'] && preg_match('/^' . $callback . '/', $output)) { |
|
| 407 | 407 | $this->response = $this->response->withType($this->mimes['jsonp']); |
| 408 | 408 | } else { |
| 409 | 409 | $this->response = $this->response->withType($mime === $this->mimes['array'] ? $this->mimes['json'] : $mime); |
@@ -459,22 +459,22 @@ discard block |
||
| 459 | 459 | private function checkProcess(): bool|ResponseInterface |
| 460 | 460 | { |
| 461 | 461 | // Verifie si la requete est en ajax |
| 462 | - if (! $this->request->is('ajax') && $this->config->ajax_only) { |
|
| 462 | + if (!$this->request->is('ajax') && $this->config->ajax_only) { |
|
| 463 | 463 | return $this->respondNotAcceptable($this->_translate('ajaxOnly')); |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | // Verifie si la requete est en https |
| 467 | - if (! $this->request->is('https') && $this->config->force_https) { |
|
| 467 | + if (!$this->request->is('https') && $this->config->force_https) { |
|
| 468 | 468 | return $this->respondForbidden($this->_translate('unsupported')); |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | // Verifie si la methode utilisee pour la requete est autorisee |
| 472 | - if (! in_array(strtoupper($this->request->getMethod()), $this->config->allowed_methods, true)) { |
|
| 472 | + if (!in_array(strtoupper($this->request->getMethod()), $this->config->allowed_methods, true)) { |
|
| 473 | 473 | return $this->respondNotAcceptable($this->_translate('unknownMethod')); |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | // Verifie que l'ip qui emet la requete n'est pas dans la blacklist |
| 477 | - if (! empty($this->config->ip_blacklis)) { |
|
| 477 | + if (!empty($this->config->ip_blacklis)) { |
|
| 478 | 478 | $this->config->ip_blacklist = implode(',', $this->config->ip_blacklist); |
| 479 | 479 | |
| 480 | 480 | // Correspond à une adresse IP dans une liste noire, par ex. 127.0.0.0, 0.0.0.0 |
@@ -487,20 +487,20 @@ discard block |
||
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | // Verifie que l'ip qui emet la requete est dans la whitelist |
| 490 | - if (! empty($this->config->ip_whitelist)) { |
|
| 490 | + if (!empty($this->config->ip_whitelist)) { |
|
| 491 | 491 | $whitelist = $this->config->ip_whitelist; |
| 492 | 492 | array_push($whitelist, '127.0.0.1', '0.0.0.0'); |
| 493 | 493 | |
| 494 | 494 | // coupez les espaces de début et de fin des ip |
| 495 | 495 | $whitelist = array_map('trim', $whitelist); |
| 496 | 496 | |
| 497 | - if (! in_array($this->request->clientIp(), $whitelist, true)) { |
|
| 497 | + if (!in_array($this->request->clientIp(), $whitelist, true)) { |
|
| 498 | 498 | return $this->respondUnauthorized($this->_translate('ipUnauthorized')); |
| 499 | 499 | } |
| 500 | 500 | } |
| 501 | 501 | |
| 502 | 502 | // Verifie l'authentification du client |
| 503 | - if (false !== $this->config->auth && ! $this->request->is('options')) { |
|
| 503 | + if (false !== $this->config->auth && !$this->request->is('options')) { |
|
| 504 | 504 | if ('bearer' === strtolower($this->config->auth)) { |
| 505 | 505 | $token = $this->getBearerToken(); |
| 506 | 506 | if (empty($token)) { |
@@ -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('url_to')) { |
|
| 451 | +if (!function_exists('url_to')) { |
|
| 452 | 452 | /** |
| 453 | 453 | * Obtenir l'URL complète et absolue d'une méthode de contrôleur |
| 454 | 454 | * (avec arguments supplémentaires) |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | */ |
| 462 | 462 | function url_to(string $controller, ...$args): string |
| 463 | 463 | { |
| 464 | - if (! $route = link_to($controller, ...$args)) { |
|
| 464 | + if (!$route = link_to($controller, ...$args)) { |
|
| 465 | 465 | $explode = explode('::', $controller); |
| 466 | 466 | |
| 467 | 467 | if (isset($explode[1])) { |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | -if (! function_exists('url_is')) { |
|
| 478 | +if (!function_exists('url_is')) { |
|
| 479 | 479 | /** |
| 480 | 480 | * Détermine si le chemin d'URL actuel contient le chemin donné. |
| 481 | 481 | * Il peut contenir un caractère générique (*) qui autorisera tout caractère valide. |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | } |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | -if (! function_exists('clean_url')) { |
|
| 496 | +if (!function_exists('clean_url')) { |
|
| 497 | 497 | function clean_url(string $url): string |
| 498 | 498 | { |
| 499 | 499 | return Helpers::cleanUrl($url); |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | use BlitzPHP\Loader\Filesystem; |
| 13 | 13 | |
| 14 | -if (! function_exists('directory_map')) { |
|
| 14 | +if (!function_exists('directory_map')) { |
|
| 15 | 15 | /** |
| 16 | 16 | * Créer une carte de répertoire |
| 17 | 17 | * |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | -if (! function_exists('directory_mirror')) { |
|
| 32 | +if (!function_exists('directory_mirror')) { |
|
| 33 | 33 | /** |
| 34 | 34 | * Copie récursivement les fichiers et répertoires du répertoire d'origine |
| 35 | 35 | * dans le répertoire cible, c'est-à-dire "miroir" son contenu. |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | -if (! function_exists('write_file')) { |
|
| 45 | +if (!function_exists('write_file')) { |
|
| 46 | 46 | /** |
| 47 | 47 | * Write File |
| 48 | 48 | * |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | -if (! function_exists('delete_files')) { |
|
| 79 | +if (!function_exists('delete_files')) { |
|
| 80 | 80 | /** |
| 81 | 81 | * Delete Files |
| 82 | 82 | * |
@@ -101,18 +101,18 @@ discard block |
||
| 101 | 101 | RecursiveIteratorIterator::CHILD_FIRST |
| 102 | 102 | ) as $object) { |
| 103 | 103 | $filename = $object->getFilename(); |
| 104 | - if (! $hidden && $filename[0] === '.') { |
|
| 104 | + if (!$hidden && $filename[0] === '.') { |
|
| 105 | 105 | continue; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if (! $htdocs || ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) { |
|
| 108 | + if (!$htdocs || !preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) { |
|
| 109 | 109 | $isDir = $object->isDir(); |
| 110 | 110 | if ($isDir && $delDir) { |
| 111 | 111 | rmdir($object->getPathname()); |
| 112 | 112 | |
| 113 | 113 | continue; |
| 114 | 114 | } |
| 115 | - if (! $isDir) { |
|
| 115 | + if (!$isDir) { |
|
| 116 | 116 | unlink($object->getPathname()); |
| 117 | 117 | } |
| 118 | 118 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | -if (! function_exists('get_filenames')) { |
|
| 128 | +if (!function_exists('get_filenames')) { |
|
| 129 | 129 | /** |
| 130 | 130 | * Get Filenames |
| 131 | 131 | * |
@@ -154,11 +154,11 @@ discard block |
||
| 154 | 154 | RecursiveIteratorIterator::SELF_FIRST |
| 155 | 155 | ) as $name => $object) { |
| 156 | 156 | $basename = pathinfo($name, PATHINFO_BASENAME); |
| 157 | - if (! $hidden && $basename[0] === '.') { |
|
| 157 | + if (!$hidden && $basename[0] === '.') { |
|
| 158 | 158 | continue; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - if ($includeDir || ! $object->isDir()) { |
|
| 161 | + if ($includeDir || !$object->isDir()) { |
|
| 162 | 162 | if ($includePath === false) { |
| 163 | 163 | $files[] = $basename; |
| 164 | 164 | } elseif ($includePath === null) { |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | -if (! function_exists('get_dir_file_info')) { |
|
| 181 | +if (!function_exists('get_dir_file_info')) { |
|
| 182 | 182 | /** |
| 183 | 183 | * Get Directory File Information |
| 184 | 184 | * |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | -if (! function_exists('get_file_info')) { |
|
| 227 | +if (!function_exists('get_file_info')) { |
|
| 228 | 228 | /** |
| 229 | 229 | * Get File Info |
| 230 | 230 | * |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | function get_file_info(string $file, $returnedValues = ['name', 'server_path', 'size', 'date']) |
| 242 | 242 | { |
| 243 | - if (! is_file($file)) { |
|
| 243 | + if (!is_file($file)) { |
|
| 244 | 244 | return null; |
| 245 | 245 | } |
| 246 | 246 | |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | } |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | -if (! function_exists('symbolic_permissions')) { |
|
| 293 | +if (!function_exists('symbolic_permissions')) { |
|
| 294 | 294 | /** |
| 295 | 295 | * Symbolic Permissions |
| 296 | 296 | * |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | -if (! function_exists('octal_permissions')) { |
|
| 341 | +if (!function_exists('octal_permissions')) { |
|
| 342 | 342 | /** |
| 343 | 343 | * Octal Permissions |
| 344 | 344 | * |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | } |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | -if (! function_exists('same_file')) { |
|
| 356 | +if (!function_exists('same_file')) { |
|
| 357 | 357 | /** |
| 358 | 358 | * Checks if two files both exist and have identical hashes |
| 359 | 359 | * |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | } |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | -if (! function_exists('set_realpath')) { |
|
| 368 | +if (!function_exists('set_realpath')) { |
|
| 369 | 369 | /** |
| 370 | 370 | * Set Realpath |
| 371 | 371 | * |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | // Resolve the path |
| 382 | 382 | if (realpath($path) !== false) { |
| 383 | 383 | $path = realpath($path); |
| 384 | - } elseif ($checkExistence && ! is_dir($path) && ! is_file($path)) { |
|
| 384 | + } elseif ($checkExistence && !is_dir($path) && !is_file($path)) { |
|
| 385 | 385 | throw new InvalidArgumentException('Not a valid path: ' . $path); |
| 386 | 386 | } |
| 387 | 387 | |
@@ -21,14 +21,14 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | function css_url(string $name) : string |
| 23 | 23 | { |
| 24 | - $name = explode('?', $name)[0]; |
|
| 25 | - $name = str_replace(site_url() . 'css/', '', htmlspecialchars($name)); |
|
| 24 | + $name = explode('?', $name)[0]; |
|
| 25 | + $name = str_replace(site_url() . 'css/', '', htmlspecialchars($name)); |
|
| 26 | 26 | |
| 27 | 27 | if (is_localfile($name)) { |
| 28 | 28 | $name .= (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
| 29 | 29 | $filename = WEBROOT.'css'.DS.$name; |
| 30 | 30 | |
| 31 | - return site_url() . 'css/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 31 | + return site_url() . 'css/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | return $name . (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
@@ -50,14 +50,14 @@ discard block |
||
| 50 | 50 | function js_url(string $name) : string |
| 51 | 51 | { |
| 52 | 52 | $name = explode('?', $name)[0]; |
| 53 | - $name = str_replace(site_url() . 'js/', '', htmlspecialchars($name)); |
|
| 53 | + $name = str_replace(site_url() . 'js/', '', htmlspecialchars($name)); |
|
| 54 | 54 | |
| 55 | 55 | if (is_localfile($name)) |
| 56 | 56 | { |
| 57 | 57 | $name .= (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
| 58 | 58 | $filename = WEBROOT.'js'.DS.$name; |
| 59 | 59 | |
| 60 | - return site_url() . 'js/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 60 | + return site_url() . 'js/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | return $name . (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
@@ -79,14 +79,14 @@ discard block |
||
| 79 | 79 | function lib_css_url(string $name) : string |
| 80 | 80 | { |
| 81 | 81 | $name = explode('?', $name)[0]; |
| 82 | - $name = str_replace(site_url() . 'lib/', '', htmlspecialchars($name)); |
|
| 82 | + $name = str_replace(site_url() . 'lib/', '', htmlspecialchars($name)); |
|
| 83 | 83 | |
| 84 | 84 | if (is_localfile($name)) |
| 85 | 85 | { |
| 86 | 86 | $name .= (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
| 87 | 87 | $filename = WEBROOT.'lib'.DS.$name; |
| 88 | 88 | |
| 89 | - return site_url() . 'lib/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 89 | + return site_url() . 'lib/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | return $name . (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | function lib_js_url(string $name) : string |
| 109 | 109 | { |
| 110 | 110 | $name = explode('?', $name)[0]; |
| 111 | - $name = str_replace(site_url() . 'lib/', '', htmlspecialchars($name)); |
|
| 111 | + $name = str_replace(site_url() . 'lib/', '', htmlspecialchars($name)); |
|
| 112 | 112 | |
| 113 | 113 | if (is_localfile($name)) |
| 114 | 114 | { |
| 115 | 115 | $name .= (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
| 116 | 116 | $filename = WEBROOT.'lib'.DS.$name; |
| 117 | 117 | |
| 118 | - return site_url() . 'lib/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 118 | + return site_url() . 'lib/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | return $name . (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
@@ -132,13 +132,13 @@ discard block |
||
| 132 | 132 | * inclu une ou plusieurs feuilles de style css |
| 133 | 133 | * |
| 134 | 134 | * @param string|string[] $name nom du fichier dont on veut inserer |
| 135 | - * @param bool $print Specifie si on affiche directement la sortie ou si on la retourne |
|
| 135 | + * @param bool $print Specifie si on affiche directement la sortie ou si on la retourne |
|
| 136 | 136 | * @return void|string |
| 137 | 137 | */ |
| 138 | 138 | function lib_styles($name, bool $print = true) |
| 139 | 139 | { |
| 140 | 140 | $name = (array) $name; |
| 141 | - $return = []; |
|
| 141 | + $return = []; |
|
| 142 | 142 | |
| 143 | 143 | foreach ($name As $style) |
| 144 | 144 | { |
@@ -152,25 +152,25 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | else if (is_localfile($style)) |
| 154 | 154 | { |
| 155 | - $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
|
| 155 | + $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
|
| 156 | 156 | $return[] = '<link rel="stylesheet" type="text/css" href="'.lib_css_url($style).'" /> -->'; |
| 157 | 157 | } |
| 158 | - else |
|
| 159 | - { |
|
| 160 | - $return[] = '<link rel="preload" type="text/css" href="'.lib_css_url($style).'" as="style"> |
|
| 158 | + else |
|
| 159 | + { |
|
| 160 | + $return[] = '<link rel="preload" type="text/css" href="'.lib_css_url($style).'" as="style"> |
|
| 161 | 161 | <link rel="stylesheet" type="text/css" href="'.lib_css_url($style).'" />'; |
| 162 | - } |
|
| 162 | + } |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - $output = join("\n", $return); |
|
| 166 | + $output = join("\n", $return); |
|
| 167 | 167 | |
| 168 | - if (false === $print) |
|
| 169 | - { |
|
| 170 | - return $output; |
|
| 171 | - } |
|
| 168 | + if (false === $print) |
|
| 169 | + { |
|
| 170 | + return $output; |
|
| 171 | + } |
|
| 172 | 172 | |
| 173 | - echo $output; |
|
| 173 | + echo $output; |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | function lib_scripts($name, bool $print = true) |
| 191 | 191 | { |
| 192 | 192 | $name = (array) $name; |
| 193 | - $return = []; |
|
| 193 | + $return = []; |
|
| 194 | 194 | |
| 195 | 195 | foreach ($name As $script) |
| 196 | 196 | { |
@@ -203,24 +203,24 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | else if (is_localfile($script)) |
| 205 | 205 | { |
| 206 | - $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
|
| 206 | + $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
|
| 207 | 207 | $return[] = '<script type="text/javascript" src="'.lib_js_url($script).'"></script> -->'; |
| 208 | 208 | } |
| 209 | - else |
|
| 210 | - { |
|
| 211 | - $return[] = '<script type="text/javascript" src="'.lib_js_url($script).'"></script>'; |
|
| 212 | - } |
|
| 209 | + else |
|
| 210 | + { |
|
| 211 | + $return[] = '<script type="text/javascript" src="'.lib_js_url($script).'"></script>'; |
|
| 212 | + } |
|
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - $output = join("\n", $return); |
|
| 216 | + $output = join("\n", $return); |
|
| 217 | 217 | |
| 218 | - if (false === $print) |
|
| 219 | - { |
|
| 220 | - return $output; |
|
| 221 | - } |
|
| 218 | + if (false === $print) |
|
| 219 | + { |
|
| 220 | + return $output; |
|
| 221 | + } |
|
| 222 | 222 | |
| 223 | - echo $output; |
|
| 223 | + echo $output; |
|
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | |
@@ -234,13 +234,13 @@ discard block |
||
| 234 | 234 | * inclu une ou plusieurs feuilles de style css |
| 235 | 235 | * |
| 236 | 236 | * @param string|string[] $name nom du fichier dont on veut inserer |
| 237 | - * @param bool $print Specifie si on affiche directement la sortie ou si on la retourne |
|
| 237 | + * @param bool $print Specifie si on affiche directement la sortie ou si on la retourne |
|
| 238 | 238 | * @return void|string |
| 239 | 239 | */ |
| 240 | 240 | function styles($name, bool $print = true) |
| 241 | 241 | { |
| 242 | 242 | $name = (array) $name; |
| 243 | - $return = []; |
|
| 243 | + $return = []; |
|
| 244 | 244 | |
| 245 | 245 | foreach ($name As $style) |
| 246 | 246 | { |
@@ -249,30 +249,30 @@ discard block |
||
| 249 | 249 | $style = (!preg_match('#\.css$#i', $style) ? $style.'.css' : $style); |
| 250 | 250 | if (is_file(WEBROOT.'css'.DS.str_replace('/', DS, $style))) |
| 251 | 251 | { |
| 252 | - $return[] = '<link rel="preload" type="text/css" href="'.css_url($style).'" as="style"> |
|
| 252 | + $return[] = '<link rel="preload" type="text/css" href="'.css_url($style).'" as="style"> |
|
| 253 | 253 | <link rel="stylesheet" type="text/css" href="'.css_url($style).'" />'; |
| 254 | 254 | } |
| 255 | 255 | else if (is_localfile($style)) |
| 256 | 256 | { |
| 257 | - $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
|
| 257 | + $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
|
| 258 | 258 | $return[] = '<link rel="stylesheet" type="text/css" href="'.css_url($style).'" /> -->'; |
| 259 | 259 | } |
| 260 | - else |
|
| 261 | - { |
|
| 262 | - $return[] = '<link rel="preload" type="text/css" href="'.css_url($style).'" as="style"> |
|
| 260 | + else |
|
| 261 | + { |
|
| 262 | + $return[] = '<link rel="preload" type="text/css" href="'.css_url($style).'" as="style"> |
|
| 263 | 263 | <link rel="stylesheet" type="text/css" href="'.css_url($style).'" />'; |
| 264 | - } |
|
| 264 | + } |
|
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | - $output = join("\n", $return); |
|
| 268 | + $output = join("\n", $return); |
|
| 269 | 269 | |
| 270 | - if (false === $print) |
|
| 271 | - { |
|
| 272 | - return $output; |
|
| 273 | - } |
|
| 270 | + if (false === $print) |
|
| 271 | + { |
|
| 272 | + return $output; |
|
| 273 | + } |
|
| 274 | 274 | |
| 275 | - echo $output; |
|
| 275 | + echo $output; |
|
| 276 | 276 | } |
| 277 | 277 | } |
| 278 | 278 | |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | function scripts($name, bool $print = true) |
| 293 | 293 | { |
| 294 | 294 | $name = (array) $name; |
| 295 | - $return = []; |
|
| 295 | + $return = []; |
|
| 296 | 296 | |
| 297 | 297 | foreach ($name As $script) |
| 298 | 298 | { |
@@ -308,21 +308,21 @@ discard block |
||
| 308 | 308 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 309 | 309 | $return[] = '<script type="text/javascript" src="'.js_url($script).'"></script> -->'; |
| 310 | 310 | } |
| 311 | - else |
|
| 312 | - { |
|
| 313 | - $return[] = '<script type="text/javascript" src="'.js_url($script).'"></script>'; |
|
| 314 | - } |
|
| 311 | + else |
|
| 312 | + { |
|
| 313 | + $return[] = '<script type="text/javascript" src="'.js_url($script).'"></script>'; |
|
| 314 | + } |
|
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | - $output = join("\n", $return); |
|
| 318 | + $output = join("\n", $return); |
|
| 319 | 319 | |
| 320 | - if (false === $print) |
|
| 321 | - { |
|
| 322 | - return $output; |
|
| 323 | - } |
|
| 320 | + if (false === $print) |
|
| 321 | + { |
|
| 322 | + return $output; |
|
| 323 | + } |
|
| 324 | 324 | |
| 325 | - echo $output; |
|
| 325 | + echo $output; |
|
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | |
@@ -341,14 +341,14 @@ discard block |
||
| 341 | 341 | function less_url(string $name) : string |
| 342 | 342 | { |
| 343 | 343 | $name = explode('?', $name)[0]; |
| 344 | - $name = str_replace(site_url() . 'less/', '', htmlspecialchars($name)); |
|
| 344 | + $name = str_replace(site_url() . 'less/', '', htmlspecialchars($name)); |
|
| 345 | 345 | |
| 346 | 346 | if (is_localfile($name)) |
| 347 | 347 | { |
| 348 | 348 | $name .= (!preg_match('#\.less$#i', $name) ? '.less' : ''); |
| 349 | 349 | $filename = WEBROOT.'less'.DS.$name; |
| 350 | 350 | |
| 351 | - return site_url() . 'less/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 351 | + return site_url() . 'less/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | return $name . (!preg_match('#\.less$#i', $name) ? '.less' : ''); |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | function less_styles($name, bool $print = true) |
| 372 | 372 | { |
| 373 | 373 | $name = (array) $name; |
| 374 | - $return = []; |
|
| 374 | + $return = []; |
|
| 375 | 375 | |
| 376 | 376 | foreach ($name As $style) |
| 377 | 377 | { |
@@ -387,21 +387,21 @@ discard block |
||
| 387 | 387 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 388 | 388 | $return[] = '<link rel="stylesheet" type="text/less" href="'.less_url($style).'" /> -->'; |
| 389 | 389 | } |
| 390 | - else |
|
| 391 | - { |
|
| 392 | - $return[] = '<link rel="stylesheet" type="text/less" href="'.less_url($style).'" />'; |
|
| 393 | - } |
|
| 390 | + else |
|
| 391 | + { |
|
| 392 | + $return[] = '<link rel="stylesheet" type="text/less" href="'.less_url($style).'" />'; |
|
| 393 | + } |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | - $output = join("\n", $return); |
|
| 397 | + $output = join("\n", $return); |
|
| 398 | 398 | |
| 399 | - if (false === $print) |
|
| 400 | - { |
|
| 401 | - return $output; |
|
| 402 | - } |
|
| 399 | + if (false === $print) |
|
| 400 | + { |
|
| 401 | + return $output; |
|
| 402 | + } |
|
| 403 | 403 | |
| 404 | - echo $output; |
|
| 404 | + echo $output; |
|
| 405 | 405 | } |
| 406 | 406 | } |
| 407 | 407 | |
@@ -421,13 +421,13 @@ discard block |
||
| 421 | 421 | function img_url(string $name) : string |
| 422 | 422 | { |
| 423 | 423 | $name = explode('?', $name)[0]; |
| 424 | - $name = str_replace(site_url() . 'img/', '', htmlspecialchars($name)); |
|
| 424 | + $name = str_replace(site_url() . 'img/', '', htmlspecialchars($name)); |
|
| 425 | 425 | |
| 426 | 426 | if (is_localfile($name)) |
| 427 | 427 | { |
| 428 | 428 | $filename = WEBROOT.'img'.DS.$name; |
| 429 | 429 | |
| 430 | - return site_url() . 'img/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 430 | + return site_url() . 'img/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | return $name; |
@@ -452,8 +452,8 @@ discard block |
||
| 452 | 452 | { |
| 453 | 453 | $return = '<img src="' . img_url($name) . '" alt="' . $alt . '"'; |
| 454 | 454 | |
| 455 | - $noprint = isset($options['print']) AND $options['print'] == false; |
|
| 456 | - unset($options['print']); |
|
| 455 | + $noprint = isset($options['print']) AND $options['print'] == false; |
|
| 456 | + unset($options['print']); |
|
| 457 | 457 | |
| 458 | 458 | foreach ($options As $key => $value) |
| 459 | 459 | { |
@@ -461,10 +461,10 @@ discard block |
||
| 461 | 461 | } |
| 462 | 462 | $return .= ' />'; |
| 463 | 463 | |
| 464 | - if ($noprint === true) |
|
| 465 | - { |
|
| 466 | - return $return; |
|
| 467 | - } |
|
| 464 | + if ($noprint === true) |
|
| 465 | + { |
|
| 466 | + return $return; |
|
| 467 | + } |
|
| 468 | 468 | |
| 469 | 469 | echo $return; |
| 470 | 470 | } |
@@ -485,13 +485,13 @@ discard block |
||
| 485 | 485 | function docs_url(string $name) : string |
| 486 | 486 | { |
| 487 | 487 | $name = explode('?', $name)[0]; |
| 488 | - $name = str_replace(site_url() . 'docs/', '', htmlspecialchars($name)); |
|
| 488 | + $name = str_replace(site_url() . 'docs/', '', htmlspecialchars($name)); |
|
| 489 | 489 | |
| 490 | 490 | if (is_localfile($name)) |
| 491 | 491 | { |
| 492 | 492 | $filename = WEBROOT.'docs'.DS.$name; |
| 493 | 493 | |
| 494 | - return site_url() . 'docs/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 494 | + return site_url() . 'docs/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 495 | 495 | } |
| 496 | 496 | |
| 497 | 497 | return $name; |
@@ -513,13 +513,13 @@ discard block |
||
| 513 | 513 | function videos_url(string $name) : string |
| 514 | 514 | { |
| 515 | 515 | $name = explode('?', $name)[0]; |
| 516 | - $name = str_replace(site_url() . 'videos/', '', htmlspecialchars($name)); |
|
| 516 | + $name = str_replace(site_url() . 'videos/', '', htmlspecialchars($name)); |
|
| 517 | 517 | |
| 518 | 518 | if (is_localfile($name)) |
| 519 | 519 | { |
| 520 | 520 | $filename = WEBROOT.'videos'.DS.$name; |
| 521 | 521 | |
| 522 | - return site_url() . 'videos/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 522 | + return site_url() . 'videos/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | return $name; |
@@ -25,10 +25,10 @@ discard block |
||
| 25 | 25 | $name = str_replace(site_url() . 'css/', '', htmlspecialchars($name)); |
| 26 | 26 | |
| 27 | 27 | if (is_localfile($name)) { |
| 28 | - $name .= (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
| 29 | - $filename = WEBROOT.'css'.DS.$name; |
|
| 28 | + $name .= (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
| 29 | + $filename = WEBROOT . 'css' . DS . $name; |
|
| 30 | 30 | |
| 31 | - return site_url() . 'css/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 31 | + return site_url() . 'css/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | return $name . (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | if (is_localfile($name)) |
| 56 | 56 | { |
| 57 | - $name .= (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
| 58 | - $filename = WEBROOT.'js'.DS.$name; |
|
| 57 | + $name .= (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
| 58 | + $filename = WEBROOT . 'js' . DS . $name; |
|
| 59 | 59 | |
| 60 | - return site_url() . 'js/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 60 | + return site_url() . 'js/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | return $name . (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
@@ -83,10 +83,10 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | if (is_localfile($name)) |
| 85 | 85 | { |
| 86 | - $name .= (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
| 87 | - $filename = WEBROOT.'lib'.DS.$name; |
|
| 86 | + $name .= (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
|
| 87 | + $filename = WEBROOT . 'lib' . DS . $name; |
|
| 88 | 88 | |
| 89 | - return site_url() . 'lib/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 89 | + return site_url() . 'lib/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | return $name . (!preg_match('#\.css$#i', $name) ? '.css' : ''); |
@@ -112,10 +112,10 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | if (is_localfile($name)) |
| 114 | 114 | { |
| 115 | - $name .= (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
| 116 | - $filename = WEBROOT.'lib'.DS.$name; |
|
| 115 | + $name .= (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
|
| 116 | + $filename = WEBROOT . 'lib' . DS . $name; |
|
| 117 | 117 | |
| 118 | - return site_url() . 'lib/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 118 | + return site_url() . 'lib/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | return $name . (!preg_match('#\.js$#i', $name) ? '.js' : ''); |
@@ -144,21 +144,21 @@ discard block |
||
| 144 | 144 | { |
| 145 | 145 | if (is_string($style)) |
| 146 | 146 | { |
| 147 | - $style = (!preg_match('#\.css$#i', $style) ? $style.'.css' : $style); |
|
| 148 | - if (is_file(WEBROOT.'lib'.DS.str_replace('/', DS, $style))) |
|
| 147 | + $style = (!preg_match('#\.css$#i', $style) ? $style . '.css' : $style); |
|
| 148 | + if (is_file(WEBROOT . 'lib' . DS . str_replace('/', DS, $style))) |
|
| 149 | 149 | { |
| 150 | - $return[] = '<link rel="preload" type="text/css" href="'.lib_css_url($style).'" as="style"> |
|
| 151 | - <link rel="stylesheet" type="text/css" href="'.lib_css_url($style).'" />'; |
|
| 150 | + $return[] = '<link rel="preload" type="text/css" href="' . lib_css_url($style) . '" as="style"> |
|
| 151 | + <link rel="stylesheet" type="text/css" href="'.lib_css_url($style) . '" />'; |
|
| 152 | 152 | } |
| 153 | 153 | else if (is_localfile($style)) |
| 154 | 154 | { |
| 155 | 155 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 156 | - $return[] = '<link rel="stylesheet" type="text/css" href="'.lib_css_url($style).'" /> -->'; |
|
| 156 | + $return[] = '<link rel="stylesheet" type="text/css" href="' . lib_css_url($style) . '" /> -->'; |
|
| 157 | 157 | } |
| 158 | 158 | else |
| 159 | 159 | { |
| 160 | - $return[] = '<link rel="preload" type="text/css" href="'.lib_css_url($style).'" as="style"> |
|
| 161 | - <link rel="stylesheet" type="text/css" href="'.lib_css_url($style).'" />'; |
|
| 160 | + $return[] = '<link rel="preload" type="text/css" href="' . lib_css_url($style) . '" as="style"> |
|
| 161 | + <link rel="stylesheet" type="text/css" href="'.lib_css_url($style) . '" />'; |
|
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | } |
@@ -196,19 +196,19 @@ discard block |
||
| 196 | 196 | { |
| 197 | 197 | if (is_string($script)) |
| 198 | 198 | { |
| 199 | - $script = (!preg_match('#\.js$#i', $script) ? $script.'.js' : $script); |
|
| 200 | - if (is_file(WEBROOT.'lib'.DS.str_replace('/', DS, $script))) |
|
| 199 | + $script = (!preg_match('#\.js$#i', $script) ? $script . '.js' : $script); |
|
| 200 | + if (is_file(WEBROOT . 'lib' . DS . str_replace('/', DS, $script))) |
|
| 201 | 201 | { |
| 202 | - $return[] = '<script type="text/javascript" src="'.lib_js_url($script).'"></script>'; |
|
| 202 | + $return[] = '<script type="text/javascript" src="' . lib_js_url($script) . '"></script>'; |
|
| 203 | 203 | } |
| 204 | 204 | else if (is_localfile($script)) |
| 205 | 205 | { |
| 206 | 206 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 207 | - $return[] = '<script type="text/javascript" src="'.lib_js_url($script).'"></script> -->'; |
|
| 207 | + $return[] = '<script type="text/javascript" src="' . lib_js_url($script) . '"></script> -->'; |
|
| 208 | 208 | } |
| 209 | 209 | else |
| 210 | 210 | { |
| 211 | - $return[] = '<script type="text/javascript" src="'.lib_js_url($script).'"></script>'; |
|
| 211 | + $return[] = '<script type="text/javascript" src="' . lib_js_url($script) . '"></script>'; |
|
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | } |
@@ -246,21 +246,21 @@ discard block |
||
| 246 | 246 | { |
| 247 | 247 | if (is_string($style)) |
| 248 | 248 | { |
| 249 | - $style = (!preg_match('#\.css$#i', $style) ? $style.'.css' : $style); |
|
| 250 | - if (is_file(WEBROOT.'css'.DS.str_replace('/', DS, $style))) |
|
| 249 | + $style = (!preg_match('#\.css$#i', $style) ? $style . '.css' : $style); |
|
| 250 | + if (is_file(WEBROOT . 'css' . DS . str_replace('/', DS, $style))) |
|
| 251 | 251 | { |
| 252 | - $return[] = '<link rel="preload" type="text/css" href="'.css_url($style).'" as="style"> |
|
| 253 | - <link rel="stylesheet" type="text/css" href="'.css_url($style).'" />'; |
|
| 252 | + $return[] = '<link rel="preload" type="text/css" href="' . css_url($style) . '" as="style"> |
|
| 253 | + <link rel="stylesheet" type="text/css" href="'.css_url($style) . '" />'; |
|
| 254 | 254 | } |
| 255 | 255 | else if (is_localfile($style)) |
| 256 | 256 | { |
| 257 | 257 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 258 | - $return[] = '<link rel="stylesheet" type="text/css" href="'.css_url($style).'" /> -->'; |
|
| 258 | + $return[] = '<link rel="stylesheet" type="text/css" href="' . css_url($style) . '" /> -->'; |
|
| 259 | 259 | } |
| 260 | 260 | else |
| 261 | 261 | { |
| 262 | - $return[] = '<link rel="preload" type="text/css" href="'.css_url($style).'" as="style"> |
|
| 263 | - <link rel="stylesheet" type="text/css" href="'.css_url($style).'" />'; |
|
| 262 | + $return[] = '<link rel="preload" type="text/css" href="' . css_url($style) . '" as="style"> |
|
| 263 | + <link rel="stylesheet" type="text/css" href="'.css_url($style) . '" />'; |
|
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | } |
@@ -296,21 +296,21 @@ discard block |
||
| 296 | 296 | |
| 297 | 297 | foreach ($name As $script) |
| 298 | 298 | { |
| 299 | - if(is_string($script)) |
|
| 299 | + if (is_string($script)) |
|
| 300 | 300 | { |
| 301 | - $script = (!preg_match('#\.js$#i', $script) ? $script.'.js' : $script); |
|
| 302 | - if (is_file(WEBROOT.'js'.DS.str_replace('/', DS, $script))) |
|
| 301 | + $script = (!preg_match('#\.js$#i', $script) ? $script . '.js' : $script); |
|
| 302 | + if (is_file(WEBROOT . 'js' . DS . str_replace('/', DS, $script))) |
|
| 303 | 303 | { |
| 304 | - $return[] = '<script type="text/javascript" src="'.js_url($script).'"></script>'; |
|
| 304 | + $return[] = '<script type="text/javascript" src="' . js_url($script) . '"></script>'; |
|
| 305 | 305 | } |
| 306 | 306 | else if (is_localfile($script)) |
| 307 | 307 | { |
| 308 | 308 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 309 | - $return[] = '<script type="text/javascript" src="'.js_url($script).'"></script> -->'; |
|
| 309 | + $return[] = '<script type="text/javascript" src="' . js_url($script) . '"></script> -->'; |
|
| 310 | 310 | } |
| 311 | 311 | else |
| 312 | 312 | { |
| 313 | - $return[] = '<script type="text/javascript" src="'.js_url($script).'"></script>'; |
|
| 313 | + $return[] = '<script type="text/javascript" src="' . js_url($script) . '"></script>'; |
|
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | } |
@@ -345,10 +345,10 @@ discard block |
||
| 345 | 345 | |
| 346 | 346 | if (is_localfile($name)) |
| 347 | 347 | { |
| 348 | - $name .= (!preg_match('#\.less$#i', $name) ? '.less' : ''); |
|
| 349 | - $filename = WEBROOT.'less'.DS.$name; |
|
| 348 | + $name .= (!preg_match('#\.less$#i', $name) ? '.less' : ''); |
|
| 349 | + $filename = WEBROOT . 'less' . DS . $name; |
|
| 350 | 350 | |
| 351 | - return site_url() . 'less/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 351 | + return site_url() . 'less/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | return $name . (!preg_match('#\.less$#i', $name) ? '.less' : ''); |
@@ -377,19 +377,19 @@ discard block |
||
| 377 | 377 | { |
| 378 | 378 | if (is_string($style)) |
| 379 | 379 | { |
| 380 | - $style = (!preg_match('#\.less$#i', $style) ? $style.'.less' : $style); |
|
| 381 | - if (is_file(WEBROOT.'less'.DS.str_replace('/', DS, $style))) |
|
| 380 | + $style = (!preg_match('#\.less$#i', $style) ? $style . '.less' : $style); |
|
| 381 | + if (is_file(WEBROOT . 'less' . DS . str_replace('/', DS, $style))) |
|
| 382 | 382 | { |
| 383 | - $return[] = '<link rel="stylesheet" type="text/less" href="'.less_url($style).'" />'; |
|
| 383 | + $return[] = '<link rel="stylesheet" type="text/less" href="' . less_url($style) . '" />'; |
|
| 384 | 384 | } |
| 385 | 385 | else if (is_localfile($style)) |
| 386 | 386 | { |
| 387 | 387 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 388 | - $return[] = '<link rel="stylesheet" type="text/less" href="'.less_url($style).'" /> -->'; |
|
| 388 | + $return[] = '<link rel="stylesheet" type="text/less" href="' . less_url($style) . '" /> -->'; |
|
| 389 | 389 | } |
| 390 | 390 | else |
| 391 | 391 | { |
| 392 | - $return[] = '<link rel="stylesheet" type="text/less" href="'.less_url($style).'" />'; |
|
| 392 | + $return[] = '<link rel="stylesheet" type="text/less" href="' . less_url($style) . '" />'; |
|
| 393 | 393 | } |
| 394 | 394 | } |
| 395 | 395 | } |
@@ -425,9 +425,9 @@ discard block |
||
| 425 | 425 | |
| 426 | 426 | if (is_localfile($name)) |
| 427 | 427 | { |
| 428 | - $filename = WEBROOT.'img'.DS.$name; |
|
| 428 | + $filename = WEBROOT . 'img' . DS . $name; |
|
| 429 | 429 | |
| 430 | - return site_url() . 'img/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 430 | + return site_url() . 'img/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | return $name; |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | |
| 458 | 458 | foreach ($options As $key => $value) |
| 459 | 459 | { |
| 460 | - $return .= ' '.$key.'="'.$value.'"'; |
|
| 460 | + $return .= ' ' . $key . '="' . $value . '"'; |
|
| 461 | 461 | } |
| 462 | 462 | $return .= ' />'; |
| 463 | 463 | |
@@ -489,9 +489,9 @@ discard block |
||
| 489 | 489 | |
| 490 | 490 | if (is_localfile($name)) |
| 491 | 491 | { |
| 492 | - $filename = WEBROOT.'docs'.DS.$name; |
|
| 492 | + $filename = WEBROOT . 'docs' . DS . $name; |
|
| 493 | 493 | |
| 494 | - return site_url() . 'docs/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 494 | + return site_url() . 'docs/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
|
| 495 | 495 | } |
| 496 | 496 | |
| 497 | 497 | return $name; |
@@ -517,9 +517,9 @@ discard block |
||
| 517 | 517 | |
| 518 | 518 | if (is_localfile($name)) |
| 519 | 519 | { |
| 520 | - $filename = WEBROOT.'videos'.DS.$name; |
|
| 520 | + $filename = WEBROOT . 'videos' . DS . $name; |
|
| 521 | 521 | |
| 522 | - return site_url() . 'videos/' . $name.((file_exists($filename)) ? '?v='.filemtime($filename) : ''); |
|
| 522 | + return site_url() . 'videos/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : ''); |
|
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | return $name; |
@@ -149,13 +149,11 @@ discard block |
||
| 149 | 149 | { |
| 150 | 150 | $return[] = '<link rel="preload" type="text/css" href="'.lib_css_url($style).'" as="style"> |
| 151 | 151 | <link rel="stylesheet" type="text/css" href="'.lib_css_url($style).'" />'; |
| 152 | - } |
|
| 153 | - else if (is_localfile($style)) |
|
| 152 | + } else if (is_localfile($style)) |
|
| 154 | 153 | { |
| 155 | 154 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 156 | 155 | $return[] = '<link rel="stylesheet" type="text/css" href="'.lib_css_url($style).'" /> -->'; |
| 157 | - } |
|
| 158 | - else |
|
| 156 | + } else |
|
| 159 | 157 | { |
| 160 | 158 | $return[] = '<link rel="preload" type="text/css" href="'.lib_css_url($style).'" as="style"> |
| 161 | 159 | <link rel="stylesheet" type="text/css" href="'.lib_css_url($style).'" />'; |
@@ -200,13 +198,11 @@ discard block |
||
| 200 | 198 | if (is_file(WEBROOT.'lib'.DS.str_replace('/', DS, $script))) |
| 201 | 199 | { |
| 202 | 200 | $return[] = '<script type="text/javascript" src="'.lib_js_url($script).'"></script>'; |
| 203 | - } |
|
| 204 | - else if (is_localfile($script)) |
|
| 201 | + } else if (is_localfile($script)) |
|
| 205 | 202 | { |
| 206 | 203 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 207 | 204 | $return[] = '<script type="text/javascript" src="'.lib_js_url($script).'"></script> -->'; |
| 208 | - } |
|
| 209 | - else |
|
| 205 | + } else |
|
| 210 | 206 | { |
| 211 | 207 | $return[] = '<script type="text/javascript" src="'.lib_js_url($script).'"></script>'; |
| 212 | 208 | } |
@@ -251,13 +247,11 @@ discard block |
||
| 251 | 247 | { |
| 252 | 248 | $return[] = '<link rel="preload" type="text/css" href="'.css_url($style).'" as="style"> |
| 253 | 249 | <link rel="stylesheet" type="text/css" href="'.css_url($style).'" />'; |
| 254 | - } |
|
| 255 | - else if (is_localfile($style)) |
|
| 250 | + } else if (is_localfile($style)) |
|
| 256 | 251 | { |
| 257 | 252 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 258 | 253 | $return[] = '<link rel="stylesheet" type="text/css" href="'.css_url($style).'" /> -->'; |
| 259 | - } |
|
| 260 | - else |
|
| 254 | + } else |
|
| 261 | 255 | { |
| 262 | 256 | $return[] = '<link rel="preload" type="text/css" href="'.css_url($style).'" as="style"> |
| 263 | 257 | <link rel="stylesheet" type="text/css" href="'.css_url($style).'" />'; |
@@ -302,13 +296,11 @@ discard block |
||
| 302 | 296 | if (is_file(WEBROOT.'js'.DS.str_replace('/', DS, $script))) |
| 303 | 297 | { |
| 304 | 298 | $return[] = '<script type="text/javascript" src="'.js_url($script).'"></script>'; |
| 305 | - } |
|
| 306 | - else if (is_localfile($script)) |
|
| 299 | + } else if (is_localfile($script)) |
|
| 307 | 300 | { |
| 308 | 301 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 309 | 302 | $return[] = '<script type="text/javascript" src="'.js_url($script).'"></script> -->'; |
| 310 | - } |
|
| 311 | - else |
|
| 303 | + } else |
|
| 312 | 304 | { |
| 313 | 305 | $return[] = '<script type="text/javascript" src="'.js_url($script).'"></script>'; |
| 314 | 306 | } |
@@ -381,13 +373,11 @@ discard block |
||
| 381 | 373 | if (is_file(WEBROOT.'less'.DS.str_replace('/', DS, $style))) |
| 382 | 374 | { |
| 383 | 375 | $return[] = '<link rel="stylesheet" type="text/less" href="'.less_url($style).'" />'; |
| 384 | - } |
|
| 385 | - else if (is_localfile($style)) |
|
| 376 | + } else if (is_localfile($style)) |
|
| 386 | 377 | { |
| 387 | 378 | $return[] = "<!-- The specified file do not exist. we can not load it. \n\t"; |
| 388 | 379 | $return[] = '<link rel="stylesheet" type="text/less" href="'.less_url($style).'" /> -->'; |
| 389 | - } |
|
| 390 | - else |
|
| 380 | + } else |
|
| 391 | 381 | { |
| 392 | 382 | $return[] = '<link rel="stylesheet" type="text/less" href="'.less_url($style).'" />'; |
| 393 | 383 | } |
@@ -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('class_path')) { |
|
| 156 | +if (!function_exists('class_path')) { |
|
| 157 | 157 | /** |
| 158 | 158 | * CLASS PATH |
| 159 | 159 | * |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | function class_path(string $name = ''): string |
| 165 | 165 | { |
| 166 | - if (! empty($name)) { |
|
| 166 | + if (!empty($name)) { |
|
| 167 | 167 | $name = DS . ltrim($name, '/\\'); |
| 168 | 168 | } |
| 169 | 169 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | -if (! function_exists('config_path')) { |
|
| 174 | +if (!function_exists('config_path')) { |
|
| 175 | 175 | /** |
| 176 | 176 | * CONFIG PATH |
| 177 | 177 | * |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | function config_path(string $name = ''): string |
| 183 | 183 | { |
| 184 | - if (! empty($name)) { |
|
| 184 | + if (!empty($name)) { |
|
| 185 | 185 | $name = DS . ltrim($name, '/\\'); |
| 186 | 186 | } |
| 187 | 187 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | -if (! function_exists('controller_path')) { |
|
| 192 | +if (!function_exists('controller_path')) { |
|
| 193 | 193 | /** |
| 194 | 194 | * CONTROLLER PATH |
| 195 | 195 | * |
@@ -200,10 +200,10 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | function controller_path(string $name = '', bool $only = true): string |
| 202 | 202 | { |
| 203 | - if (! empty($name)) { |
|
| 203 | + if (!empty($name)) { |
|
| 204 | 204 | $name = ltrim($name, '/\\'); |
| 205 | 205 | |
| 206 | - if ($only === true && ! preg_match('#Controller\.php$#', $name)) { |
|
| 206 | + if ($only === true && !preg_match('#Controller\.php$#', $name)) { |
|
| 207 | 207 | $name = ucfirst(strtolower($name)) . 'Controller.php'; |
| 208 | 208 | } |
| 209 | 209 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | -if (! function_exists('entity_path')) { |
|
| 215 | +if (!function_exists('entity_path')) { |
|
| 216 | 216 | /** |
| 217 | 217 | * ENTITY PATH |
| 218 | 218 | * |
@@ -223,10 +223,10 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | function entity_path(string $name = '', bool $only = true): string |
| 225 | 225 | { |
| 226 | - if (! empty($name)) { |
|
| 226 | + if (!empty($name)) { |
|
| 227 | 227 | $name = ltrim($name, '/\\'); |
| 228 | 228 | |
| 229 | - if ($only === true && ! preg_match('#Entity\.php$#', $name)) { |
|
| 229 | + if ($only === true && !preg_match('#Entity\.php$#', $name)) { |
|
| 230 | 230 | $name = ucfirst($name) . 'Entity.php'; |
| 231 | 231 | } |
| 232 | 232 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | -if (! function_exists('helper_path')) { |
|
| 238 | +if (!function_exists('helper_path')) { |
|
| 239 | 239 | /** |
| 240 | 240 | * HELPER PATH |
| 241 | 241 | * |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | function helper_path(string $name = '', bool $system = false): string |
| 248 | 248 | { |
| 249 | - if (! empty($name)) { |
|
| 249 | + if (!empty($name)) { |
|
| 250 | 250 | $name = DS . ltrim($name, '/\\'); |
| 251 | 251 | } |
| 252 | 252 | if ($system === true) { |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | -if (! function_exists('library_path')) { |
|
| 260 | +if (!function_exists('library_path')) { |
|
| 261 | 261 | /** |
| 262 | 262 | * LIBRARY PATH |
| 263 | 263 | * |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | function library_path(string $name = '', bool $system = false): string |
| 270 | 270 | { |
| 271 | - if (! empty($name)) { |
|
| 271 | + if (!empty($name)) { |
|
| 272 | 272 | $name = DS . ltrim($name, '/\\'); |
| 273 | 273 | } |
| 274 | 274 | if ($system === true) { |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | -if (! function_exists('middleware_path')) { |
|
| 282 | +if (!function_exists('middleware_path')) { |
|
| 283 | 283 | /** |
| 284 | 284 | * MIDDLEWARE PATH |
| 285 | 285 | * |
@@ -291,10 +291,10 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | function middleware_path(string $name = '', bool $system = false, bool $only = true): string |
| 293 | 293 | { |
| 294 | - if (! empty($name)) { |
|
| 294 | + if (!empty($name)) { |
|
| 295 | 295 | $name = DS . ltrim($name, '/\\'); |
| 296 | 296 | |
| 297 | - if ($only === true && ! preg_match('#Middleware\.php$#', $name)) { |
|
| 297 | + if ($only === true && !preg_match('#Middleware\.php$#', $name)) { |
|
| 298 | 298 | $name = ucfirst($name) . 'Middleware.php'; |
| 299 | 299 | } |
| 300 | 300 | } |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | } |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | -if (! function_exists('model_path')) { |
|
| 309 | +if (!function_exists('model_path')) { |
|
| 310 | 310 | /** |
| 311 | 311 | * MODEL PATH |
| 312 | 312 | * |
@@ -317,10 +317,10 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | function model_path(string $name = '', bool $only = true): string |
| 319 | 319 | { |
| 320 | - if (! empty($name)) { |
|
| 320 | + if (!empty($name)) { |
|
| 321 | 321 | $name = ltrim($name, '/\\'); |
| 322 | 322 | |
| 323 | - if ($only === true && ! preg_match('#Model\.php$#', $name)) { |
|
| 323 | + if ($only === true && !preg_match('#Model\.php$#', $name)) { |
|
| 324 | 324 | $name = ucfirst(strtolower($name)) . 'Model.php'; |
| 325 | 325 | } |
| 326 | 326 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | } |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | -if (! function_exists('resource_path')) { |
|
| 332 | +if (!function_exists('resource_path')) { |
|
| 333 | 333 | /** |
| 334 | 334 | * RESOURCE PATH |
| 335 | 335 | * |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | */ |
| 340 | 340 | function resource_path(string $name = ''): string |
| 341 | 341 | { |
| 342 | - if (! empty($name)) { |
|
| 342 | + if (!empty($name)) { |
|
| 343 | 343 | $name = ltrim($name, '/\\'); |
| 344 | 344 | } |
| 345 | 345 | |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | } |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | -if (! function_exists('migration_path')) { |
|
| 350 | +if (!function_exists('migration_path')) { |
|
| 351 | 351 | /** |
| 352 | 352 | * MIGRATION PATH |
| 353 | 353 | * |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | */ |
| 358 | 358 | function migration_path(string $name = ''): string |
| 359 | 359 | { |
| 360 | - if (! empty($name)) { |
|
| 360 | + if (!empty($name)) { |
|
| 361 | 361 | $name = ltrim($name, '/\\'); |
| 362 | 362 | } |
| 363 | 363 | |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | } |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | -if (! function_exists('seed_path')) { |
|
| 368 | +if (!function_exists('seed_path')) { |
|
| 369 | 369 | /** |
| 370 | 370 | * SEED PATH |
| 371 | 371 | * |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | */ |
| 376 | 376 | function seed_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('lang_path')) { |
|
| 386 | +if (!function_exists('lang_path')) { |
|
| 387 | 387 | /** |
| 388 | 388 | * LANG PATH |
| 389 | 389 | * |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | */ |
| 395 | 395 | function lang_path(string $name = '', bool $system = false): string |
| 396 | 396 | { |
| 397 | - if (! empty($name)) { |
|
| 397 | + if (!empty($name)) { |
|
| 398 | 398 | $name = DS . ltrim($name, '/\\'); |
| 399 | 399 | } |
| 400 | 400 | if ($system === true) { |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | } |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | -if (! function_exists('service_path')) { |
|
| 408 | +if (!function_exists('service_path')) { |
|
| 409 | 409 | /** |
| 410 | 410 | * SERVICE PATH |
| 411 | 411 | * |
@@ -416,10 +416,10 @@ discard block |
||
| 416 | 416 | */ |
| 417 | 417 | function service_path(string $name = '', bool $only = true): string |
| 418 | 418 | { |
| 419 | - if (! empty($name)) { |
|
| 419 | + if (!empty($name)) { |
|
| 420 | 420 | $name = ltrim($name, '/\\'); |
| 421 | 421 | |
| 422 | - if ($only === true && ! preg_match('#Service\.php$#', $name)) { |
|
| 422 | + if ($only === true && !preg_match('#Service\.php$#', $name)) { |
|
| 423 | 423 | $name = ucfirst($name) . 'Service.php'; |
| 424 | 424 | } |
| 425 | 425 | } |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | } |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | -if (! function_exists('view_path')) { |
|
| 431 | +if (!function_exists('view_path')) { |
|
| 432 | 432 | /** |
| 433 | 433 | * VIEW PATH |
| 434 | 434 | * |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | */ |
| 439 | 439 | function view_path(string $name = ''): string |
| 440 | 440 | { |
| 441 | - if (! empty($name)) { |
|
| 441 | + if (!empty($name)) { |
|
| 442 | 442 | $name = ltrim($name, '/\\'); |
| 443 | 443 | } |
| 444 | 444 | |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | } |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | -if (! function_exists('layout_path')) { |
|
| 449 | +if (!function_exists('layout_path')) { |
|
| 450 | 450 | /** |
| 451 | 451 | * LAYOUT PATH |
| 452 | 452 | * |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | */ |
| 457 | 457 | function layout_path(string $name = ''): string |
| 458 | 458 | { |
| 459 | - if (! empty($name)) { |
|
| 459 | + if (!empty($name)) { |
|
| 460 | 460 | $name = ltrim($name, '/\\'); |
| 461 | 461 | } |
| 462 | 462 | |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | } |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | -if (! function_exists('partial_path')) { |
|
| 467 | +if (!function_exists('partial_path')) { |
|
| 468 | 468 | /** |
| 469 | 469 | * PARTIAL PATH |
| 470 | 470 | * |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | */ |
| 475 | 475 | function partial_path(string $name = ''): string |
| 476 | 476 | { |
| 477 | - if (! empty($name)) { |
|
| 477 | + if (!empty($name)) { |
|
| 478 | 478 | $name = DS . ltrim($name, '/\\'); |
| 479 | 479 | } |
| 480 | 480 | |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | } |
| 483 | 483 | } |
| 484 | 484 | |
| 485 | -if (! function_exists('app_path')) { |
|
| 485 | +if (!function_exists('app_path')) { |
|
| 486 | 486 | /** |
| 487 | 487 | * APP PATH |
| 488 | 488 | * |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | */ |
| 493 | 493 | function app_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('cache_path')) { |
|
| 503 | +if (!function_exists('cache_path')) { |
|
| 504 | 504 | /** |
| 505 | 505 | * CACHE PATH |
| 506 | 506 | * |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | */ |
| 511 | 511 | function cache_path(string $name = ''): string |
| 512 | 512 | { |
| 513 | - if (! empty($name)) { |
|
| 513 | + if (!empty($name)) { |
|
| 514 | 514 | $name = ltrim($name, '/\\'); |
| 515 | 515 | } |
| 516 | 516 | |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | } |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | -if (! function_exists('dump_path')) { |
|
| 521 | +if (!function_exists('dump_path')) { |
|
| 522 | 522 | /** |
| 523 | 523 | * DUMP PATH |
| 524 | 524 | * |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | */ |
| 529 | 529 | function dump_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('storage_path')) { |
|
| 539 | +if (!function_exists('storage_path')) { |
|
| 540 | 540 | /** |
| 541 | 541 | * STORAGE PATH |
| 542 | 542 | * |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | */ |
| 547 | 547 | function storage_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('css_exist')) { |
|
| 557 | +if (!function_exists('css_exist')) { |
|
| 558 | 558 | /** |
| 559 | 559 | * CSS EXIST |
| 560 | 560 | * |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | } |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | -if (! function_exists('js_exist')) { |
|
| 571 | +if (!function_exists('js_exist')) { |
|
| 572 | 572 | /** |
| 573 | 573 | * JS EXIST |
| 574 | 574 | * |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | -if (! function_exists('lib_exist')) { |
|
| 585 | +if (!function_exists('lib_exist')) { |
|
| 586 | 586 | /** |
| 587 | 587 | * LIB EXIST |
| 588 | 588 | * |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | } |
| 597 | 597 | } |
| 598 | 598 | |
| 599 | -if (! function_exists('less_exist')) { |
|
| 599 | +if (!function_exists('less_exist')) { |
|
| 600 | 600 | /** |
| 601 | 601 | * LESS EXIST |
| 602 | 602 | * |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | } |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | -if (! function_exists('img_exist')) { |
|
| 613 | +if (!function_exists('img_exist')) { |
|
| 614 | 614 | /** |
| 615 | 615 | * IMG EXIST |
| 616 | 616 | * |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | } |
| 625 | 625 | } |
| 626 | 626 | |
| 627 | -if (! function_exists('doc_exist')) { |
|
| 627 | +if (!function_exists('doc_exist')) { |
|
| 628 | 628 | /** |
| 629 | 629 | * DOC EXIST |
| 630 | 630 | * |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | } |
| 639 | 639 | } |
| 640 | 640 | |
| 641 | -if (! function_exists('video_exist')) { |
|
| 641 | +if (!function_exists('video_exist')) { |
|
| 642 | 642 | /** |
| 643 | 643 | * VIDEO EXIST |
| 644 | 644 | * |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | } |
| 653 | 653 | } |
| 654 | 654 | |
| 655 | -if (! function_exists('public_exist')) { |
|
| 655 | +if (!function_exists('public_exist')) { |
|
| 656 | 656 | /** |
| 657 | 657 | * PUBLIC EXIST |
| 658 | 658 | * |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | } |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | -if (! function_exists('class_exist')) { |
|
| 669 | +if (!function_exists('class_exist')) { |
|
| 670 | 670 | /** |
| 671 | 671 | * CLASS EXIST |
| 672 | 672 | * |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | } |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | -if (! function_exists('config_exist')) { |
|
| 683 | +if (!function_exists('config_exist')) { |
|
| 684 | 684 | /** |
| 685 | 685 | * CONFIG EXIST |
| 686 | 686 | * |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | } |
| 695 | 695 | } |
| 696 | 696 | |
| 697 | -if (! function_exists('controller_exist')) { |
|
| 697 | +if (!function_exists('controller_exist')) { |
|
| 698 | 698 | /** |
| 699 | 699 | * CONTROLLER EXIST |
| 700 | 700 | * |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | } |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | -if (! function_exists('entity_exist')) { |
|
| 712 | +if (!function_exists('entity_exist')) { |
|
| 713 | 713 | /** |
| 714 | 714 | * ENTITY EXIST |
| 715 | 715 | * |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | } |
| 725 | 725 | } |
| 726 | 726 | |
| 727 | -if (! function_exists('helper_exist')) { |
|
| 727 | +if (!function_exists('helper_exist')) { |
|
| 728 | 728 | /** |
| 729 | 729 | * HELPER EXIST |
| 730 | 730 | * |
@@ -739,7 +739,7 @@ discard block |
||
| 739 | 739 | } |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | -if (! function_exists('library_exist')) { |
|
| 742 | +if (!function_exists('library_exist')) { |
|
| 743 | 743 | /** |
| 744 | 744 | * LIBRARY EXIST |
| 745 | 745 | * |
@@ -754,7 +754,7 @@ discard block |
||
| 754 | 754 | } |
| 755 | 755 | } |
| 756 | 756 | |
| 757 | -if (! function_exists('middleware_exist')) { |
|
| 757 | +if (!function_exists('middleware_exist')) { |
|
| 758 | 758 | /** |
| 759 | 759 | * MIDDLEWARE EXIST |
| 760 | 760 | * |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | } |
| 771 | 771 | } |
| 772 | 772 | |
| 773 | -if (! function_exists('model_exist')) { |
|
| 773 | +if (!function_exists('model_exist')) { |
|
| 774 | 774 | /** |
| 775 | 775 | * MODEL EXIST |
| 776 | 776 | * |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | } |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | -if (! function_exists('resource_exist')) { |
|
| 788 | +if (!function_exists('resource_exist')) { |
|
| 789 | 789 | /** |
| 790 | 790 | * RESOURCE EXIST |
| 791 | 791 | * |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | } |
| 800 | 800 | } |
| 801 | 801 | |
| 802 | -if (! function_exists('migration_exist')) { |
|
| 802 | +if (!function_exists('migration_exist')) { |
|
| 803 | 803 | /** |
| 804 | 804 | * MIGRATION EXIST |
| 805 | 805 | * |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | } |
| 814 | 814 | } |
| 815 | 815 | |
| 816 | -if (! function_exists('seed_exist')) { |
|
| 816 | +if (!function_exists('seed_exist')) { |
|
| 817 | 817 | /** |
| 818 | 818 | * SEED EXIST |
| 819 | 819 | * |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | } |
| 828 | 828 | } |
| 829 | 829 | |
| 830 | -if (! function_exists('lang_exist')) { |
|
| 830 | +if (!function_exists('lang_exist')) { |
|
| 831 | 831 | /** |
| 832 | 832 | * LANG EXIST |
| 833 | 833 | * |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | } |
| 843 | 843 | } |
| 844 | 844 | |
| 845 | -if (! function_exists('service_exist')) { |
|
| 845 | +if (!function_exists('service_exist')) { |
|
| 846 | 846 | /** |
| 847 | 847 | * SERVICE EXIST |
| 848 | 848 | * |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | } |
| 858 | 858 | } |
| 859 | 859 | |
| 860 | -if (! function_exists('view_exist')) { |
|
| 860 | +if (!function_exists('view_exist')) { |
|
| 861 | 861 | /** |
| 862 | 862 | * VIEW EXIST |
| 863 | 863 | * |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | } |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | -if (! function_exists('layout_exist')) { |
|
| 874 | +if (!function_exists('layout_exist')) { |
|
| 875 | 875 | /** |
| 876 | 876 | * LAYOUT EXIST |
| 877 | 877 | * |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | } |
| 886 | 886 | } |
| 887 | 887 | |
| 888 | -if (! function_exists('partial_exist')) { |
|
| 888 | +if (!function_exists('partial_exist')) { |
|
| 889 | 889 | /** |
| 890 | 890 | * PARTIAL EXIST |
| 891 | 891 | * |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | } |
| 900 | 900 | } |
| 901 | 901 | |
| 902 | -if (! function_exists('app_exist')) { |
|
| 902 | +if (!function_exists('app_exist')) { |
|
| 903 | 903 | /** |
| 904 | 904 | * APP EXIST |
| 905 | 905 | * |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | } |
| 914 | 914 | } |
| 915 | 915 | |
| 916 | -if (! function_exists('cache_exist')) { |
|
| 916 | +if (!function_exists('cache_exist')) { |
|
| 917 | 917 | /** |
| 918 | 918 | * CACHE EXIST |
| 919 | 919 | * |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | } |
| 928 | 928 | } |
| 929 | 929 | |
| 930 | -if (! function_exists('dump_exist')) { |
|
| 930 | +if (!function_exists('dump_exist')) { |
|
| 931 | 931 | /** |
| 932 | 932 | * DUMP EXIST |
| 933 | 933 | * |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | } |
| 942 | 942 | } |
| 943 | 943 | |
| 944 | -if (! function_exists('storage_exist')) { |
|
| 944 | +if (!function_exists('storage_exist')) { |
|
| 945 | 945 | /** |
| 946 | 946 | * STORAGE EXIST |
| 947 | 947 | * |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | } |
| 956 | 956 | } |
| 957 | 957 | |
| 958 | -if (! function_exists('include_config')) { |
|
| 958 | +if (!function_exists('include_config')) { |
|
| 959 | 959 | /** |
| 960 | 960 | * INCLUDE CONFIG |
| 961 | 961 | * |
@@ -973,7 +973,7 @@ discard block |
||
| 973 | 973 | } |
| 974 | 974 | } |
| 975 | 975 | |
| 976 | -if (! function_exists('include_controller')) { |
|
| 976 | +if (!function_exists('include_controller')) { |
|
| 977 | 977 | /** |
| 978 | 978 | * INCLUDE CONTROLLER |
| 979 | 979 | * |
@@ -992,7 +992,7 @@ discard block |
||
| 992 | 992 | } |
| 993 | 993 | } |
| 994 | 994 | |
| 995 | -if (! function_exists('include_class')) { |
|
| 995 | +if (!function_exists('include_class')) { |
|
| 996 | 996 | /** |
| 997 | 997 | * INCLUDE CLASS |
| 998 | 998 | * |
@@ -1010,7 +1010,7 @@ discard block |
||
| 1010 | 1010 | } |
| 1011 | 1011 | } |
| 1012 | 1012 | |
| 1013 | -if (! function_exists('include_entity')) { |
|
| 1013 | +if (!function_exists('include_entity')) { |
|
| 1014 | 1014 | /** |
| 1015 | 1015 | * INCLUDE ENTITY |
| 1016 | 1016 | * |
@@ -1029,7 +1029,7 @@ discard block |
||
| 1029 | 1029 | } |
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | -if (! function_exists('include_helper')) { |
|
| 1032 | +if (!function_exists('include_helper')) { |
|
| 1033 | 1033 | /** |
| 1034 | 1034 | * INCLUDE HELPER |
| 1035 | 1035 | * |
@@ -1047,7 +1047,7 @@ discard block |
||
| 1047 | 1047 | } |
| 1048 | 1048 | } |
| 1049 | 1049 | |
| 1050 | -if (! function_exists('include_library')) { |
|
| 1050 | +if (!function_exists('include_library')) { |
|
| 1051 | 1051 | /** |
| 1052 | 1052 | * INCLUDE LIBRARY |
| 1053 | 1053 | * |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | } |
| 1067 | 1067 | } |
| 1068 | 1068 | |
| 1069 | -if (! function_exists('include_middleware')) { |
|
| 1069 | +if (!function_exists('include_middleware')) { |
|
| 1070 | 1070 | /** |
| 1071 | 1071 | * INCLUDE MIDDLEWARE |
| 1072 | 1072 | * |
@@ -1086,7 +1086,7 @@ discard block |
||
| 1086 | 1086 | } |
| 1087 | 1087 | } |
| 1088 | 1088 | |
| 1089 | -if (! function_exists('include_model')) { |
|
| 1089 | +if (!function_exists('include_model')) { |
|
| 1090 | 1090 | /** |
| 1091 | 1091 | * INCLUDE MODEL |
| 1092 | 1092 | * |
@@ -1105,7 +1105,7 @@ discard block |
||
| 1105 | 1105 | } |
| 1106 | 1106 | } |
| 1107 | 1107 | |
| 1108 | -if (! function_exists('include_resource')) { |
|
| 1108 | +if (!function_exists('include_resource')) { |
|
| 1109 | 1109 | /** |
| 1110 | 1110 | * INCLUDE RESOURCE |
| 1111 | 1111 | * |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | } |
| 1124 | 1124 | } |
| 1125 | 1125 | |
| 1126 | -if (! function_exists('include_service')) { |
|
| 1126 | +if (!function_exists('include_service')) { |
|
| 1127 | 1127 | /** |
| 1128 | 1128 | * INCLUDE SERVICE |
| 1129 | 1129 | * |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | } |
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | -if (! function_exists('include_view')) { |
|
| 1145 | +if (!function_exists('include_view')) { |
|
| 1146 | 1146 | /** |
| 1147 | 1147 | * INCLUDE VIEW |
| 1148 | 1148 | * |
@@ -1160,7 +1160,7 @@ discard block |
||
| 1160 | 1160 | } |
| 1161 | 1161 | } |
| 1162 | 1162 | |
| 1163 | -if (! function_exists('include_layout')) { |
|
| 1163 | +if (!function_exists('include_layout')) { |
|
| 1164 | 1164 | /** |
| 1165 | 1165 | * INCLUDE LAYOUT |
| 1166 | 1166 | * |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | } |
| 1179 | 1179 | } |
| 1180 | 1180 | |
| 1181 | -if (! function_exists('include_partial')) { |
|
| 1181 | +if (!function_exists('include_partial')) { |
|
| 1182 | 1182 | /** |
| 1183 | 1183 | * INCLUDE PARTIAL |
| 1184 | 1184 | * |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | } |
| 1197 | 1197 | } |
| 1198 | 1198 | |
| 1199 | -if (! function_exists('_include_path')) { |
|
| 1199 | +if (!function_exists('_include_path')) { |
|
| 1200 | 1200 | /** |
| 1201 | 1201 | * inclus un fichier |
| 1202 | 1202 | * |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | use BlitzPHP\Utilities\Inflector; |
| 13 | 13 | |
| 14 | -if (! function_exists('camelize')) { |
|
| 14 | +if (!function_exists('camelize')) { |
|
| 15 | 15 | /** |
| 16 | 16 | * Camelize |
| 17 | 17 | * |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -if (! function_exists('classify')) { |
|
| 28 | +if (!function_exists('classify')) { |
|
| 29 | 29 | /** |
| 30 | 30 | * Returns model class name ("Person" for the database table "people".) for given database table. |
| 31 | 31 | * |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | -if (! function_exists('dasherize')) { |
|
| 42 | +if (!function_exists('dasherize')) { |
|
| 43 | 43 | /** |
| 44 | 44 | * Returns the input CamelCasedString as an dashed-string. |
| 45 | 45 | * |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | -if (! function_exists('delimit')) { |
|
| 58 | +if (!function_exists('delimit')) { |
|
| 59 | 59 | /** |
| 60 | 60 | * Expects a CamelCasedInputString, and produces a lower_case_delimited_string |
| 61 | 61 | * |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | -if (! function_exists('humanize')) { |
|
| 73 | +if (!function_exists('humanize')) { |
|
| 74 | 74 | /** |
| 75 | 75 | * Humanize |
| 76 | 76 | * |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | -if (! function_exists('plural')) { |
|
| 88 | +if (!function_exists('plural')) { |
|
| 89 | 89 | /** |
| 90 | 90 | * Plural |
| 91 | 91 | * |
@@ -99,30 +99,30 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | $result = (string) $str; |
| 101 | 101 | |
| 102 | - if (! is_countable($result)) { |
|
| 102 | + if (!is_countable($result)) { |
|
| 103 | 103 | return $result; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $plural_rules = [ |
| 107 | - '/(quiz)$/' => '\1zes', // quizzes |
|
| 108 | - '/^(ox)$/' => '\1\2en', // ox |
|
| 109 | - '/([m|l])ouse$/' => '\1ice', // mouse, louse |
|
| 110 | - '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index |
|
| 111 | - '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address |
|
| 112 | - '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency |
|
| 113 | - '/(hive)$/' => '\1s', // archive, hive |
|
| 114 | - '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife |
|
| 115 | - '/sis$/' => 'ses', // basis, diagnosis |
|
| 116 | - '/([ti])um$/' => '\1a', // datum, medium |
|
| 117 | - '/(p)erson$/' => '\1eople', // person, salesperson |
|
| 118 | - '/(m)an$/' => '\1en', // man, woman, spokesman |
|
| 119 | - '/(c)hild$/' => '\1hildren', // child |
|
| 120 | - '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato |
|
| 121 | - '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
| 122 | - '/(alias|status|virus)$/' => '\1es', // alias |
|
| 123 | - '/(octop)us$/' => '\1i', // octopus |
|
| 124 | - '/(ax|cris|test)is$/' => '\1es', // axis, crisis |
|
| 125 | - '/s$/' => 's', // no change (compatibility) |
|
| 107 | + '/(quiz)$/' => '\1zes', // quizzes |
|
| 108 | + '/^(ox)$/' => '\1\2en', // ox |
|
| 109 | + '/([m|l])ouse$/' => '\1ice', // mouse, louse |
|
| 110 | + '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index |
|
| 111 | + '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address |
|
| 112 | + '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency |
|
| 113 | + '/(hive)$/' => '\1s', // archive, hive |
|
| 114 | + '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife |
|
| 115 | + '/sis$/' => 'ses', // basis, diagnosis |
|
| 116 | + '/([ti])um$/' => '\1a', // datum, medium |
|
| 117 | + '/(p)erson$/' => '\1eople', // person, salesperson |
|
| 118 | + '/(m)an$/' => '\1en', // man, woman, spokesman |
|
| 119 | + '/(c)hild$/' => '\1hildren', // child |
|
| 120 | + '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato |
|
| 121 | + '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
| 122 | + '/(alias|status|virus)$/' => '\1es', // alias |
|
| 123 | + '/(octop)us$/' => '\1i', // octopus |
|
| 124 | + '/(ax|cris|test)is$/' => '\1es', // axis, crisis |
|
| 125 | + '/s$/' => 's', // no change (compatibility) |
|
| 126 | 126 | '/$/' => 's', |
| 127 | 127 | ]; |
| 128 | 128 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | -if (! function_exists('pluralize')) { |
|
| 140 | +if (!function_exists('pluralize')) { |
|
| 141 | 141 | /** |
| 142 | 142 | * Return $word in plural form. |
| 143 | 143 | * |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | -if (! function_exists('singular')) { |
|
| 154 | +if (!function_exists('singular')) { |
|
| 155 | 155 | /** |
| 156 | 156 | * Singular |
| 157 | 157 | * |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | { |
| 166 | 166 | $result = (string) $str; |
| 167 | 167 | |
| 168 | - if (! is_countable($result)) { |
|
| 168 | + if (!is_countable($result)) { |
|
| 169 | 169 | return $result; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | -if (! function_exists('singularize')) { |
|
| 214 | +if (!function_exists('singularize')) { |
|
| 215 | 215 | /** |
| 216 | 216 | * Return $word in singular form. |
| 217 | 217 | * |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | -if (! function_exists('tableize')) { |
|
| 228 | +if (!function_exists('tableize')) { |
|
| 229 | 229 | /** |
| 230 | 230 | * Returns corresponding table name for given model $className. ("people" for the model class "Person"). |
| 231 | 231 | * |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | -if (! function_exists('underscore')) { |
|
| 242 | +if (!function_exists('underscore')) { |
|
| 243 | 243 | /** |
| 244 | 244 | * Underscore |
| 245 | 245 | * |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | -if (! function_exists('variable')) { |
|
| 256 | +if (!function_exists('variable')) { |
|
| 257 | 257 | /** |
| 258 | 258 | * Returns camelBacked version of an underscored string. |
| 259 | 259 | * |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | -if (! function_exists('counted')) { |
|
| 270 | +if (!function_exists('counted')) { |
|
| 271 | 271 | /** |
| 272 | 272 | * Counted |
| 273 | 273 | * |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | -if (! function_exists('pascalize')) { |
|
| 288 | +if (!function_exists('pascalize')) { |
|
| 289 | 289 | /** |
| 290 | 290 | * Pascalize |
| 291 | 291 | * |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | } |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | -if (! function_exists('is_pluralizable')) { |
|
| 304 | +if (!function_exists('is_pluralizable')) { |
|
| 305 | 305 | /** |
| 306 | 306 | * Checks if the given word has a plural version. |
| 307 | 307 | * |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | */ |
| 310 | 310 | function is_pluralizable(string $word): bool |
| 311 | 311 | { |
| 312 | - return ! in_array( |
|
| 312 | + return !in_array( |
|
| 313 | 313 | strtolower($word), |
| 314 | 314 | [ |
| 315 | 315 | 'advice', |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | -if (! function_exists('ordinal')) { |
|
| 387 | +if (!function_exists('ordinal')) { |
|
| 388 | 388 | /** |
| 389 | 389 | * Returns the suffix that should be added to a |
| 390 | 390 | * number to denote the position in an ordered |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | -if (! function_exists('ordinalize')) { |
|
| 414 | +if (!function_exists('ordinalize')) { |
|
| 415 | 415 | /** |
| 416 | 416 | * Turns a number into an ordinal string used |
| 417 | 417 | * to denote the position in an ordered sequence |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | $file = $this->viewPath . $view; |
| 98 | 98 | |
| 99 | - if (! is_file($file)) { |
|
| 99 | + if (!is_file($file)) { |
|
| 100 | 100 | $fileOrig = $file; |
| 101 | 101 | $file = $this->loader->locateFile($view, 'Views'); |
| 102 | 102 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | public function setData(array $data = [], ?string $context = null): self |
| 173 | 173 | { |
| 174 | - if (! empty($context)) { |
|
| 174 | + if (!empty($context)) { |
|
| 175 | 175 | foreach ($data as $key => &$value) { |
| 176 | 176 | if (is_array($value)) { |
| 177 | 177 | foreach ($value as &$obj) { |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | foreach ($matches as $match) { |
| 280 | 280 | // Loop over each piece of $data, replacing |
| 281 | 281 | // its contents so that we know what to replace in parse() |
| 282 | - $str = ''; // holds the new contents for this tag pair. |
|
| 282 | + $str = ''; // holds the new contents for this tag pair. |
|
| 283 | 283 | |
| 284 | 284 | foreach ($data as $row) { |
| 285 | 285 | // Objects that have a `toArray()` method should be |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | if (is_array($val)) { |
| 302 | 302 | $pair = $this->parsePair($key, $val, $match[1]); |
| 303 | 303 | |
| 304 | - if (! empty($pair)) { |
|
| 304 | + if (!empty($pair)) { |
|
| 305 | 305 | $pairs[array_keys($pair)[0]] = true; |
| 306 | 306 | |
| 307 | 307 | $temp = array_merge($temp, $pair); |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | // Now replace our placeholders with the new content. |
| 323 | 323 | foreach ($temp as $pattern => $content) { |
| 324 | - $out = $this->replaceSingle($pattern, $content, $out, ! isset($pairs[$pattern])); |
|
| 324 | + $out = $this->replaceSingle($pattern, $content, $out, !isset($pairs[$pattern])); |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | $str .= $out; |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | $content = (string) $content; |
| 492 | 492 | |
| 493 | 493 | // Replace the content in the template |
| 494 | - return preg_replace_callback($pattern, function ($matches) use ($content, $escape) { |
|
| 494 | + return preg_replace_callback($pattern, function($matches) use ($content, $escape) { |
|
| 495 | 495 | // Check for {! !} syntax to not escape this one. |
| 496 | 496 | if (strpos($matches[0], '{!') === 0 && substr($matches[0], -2) === '!}') { |
| 497 | 497 | $escape = false; |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | |
| 511 | 511 | // Our regex earlier will leave all chained values on a single line |
| 512 | 512 | // so we need to break them apart so we can apply them all. |
| 513 | - $filters = ! empty($matches[1]) ? explode('|', $matches[1]) : []; |
|
| 513 | + $filters = !empty($matches[1]) ? explode('|', $matches[1]) : []; |
|
| 514 | 514 | |
| 515 | 515 | if ($escape && empty($filters) && ($context = $this->shouldAddEscaping($orig))) { |
| 516 | 516 | $filters[] = "esc({$context})"; |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | $escape = false; |
| 547 | 547 | } |
| 548 | 548 | // If no `esc` filter is found, then we'll need to add one. |
| 549 | - elseif (! preg_match('/\s+esc/', $key)) { |
|
| 549 | + elseif (!preg_match('/\s+esc/', $key)) { |
|
| 550 | 550 | $escape = 'html'; |
| 551 | 551 | } |
| 552 | 552 | |
@@ -565,10 +565,10 @@ discard block |
||
| 565 | 565 | preg_match('/\([\w<>=\/\\\,:.\-\s\+]+\)/', $filter, $param); |
| 566 | 566 | |
| 567 | 567 | // Remove the () and spaces to we have just the parameter left |
| 568 | - $param = ! empty($param) ? trim($param[0], '() ') : null; |
|
| 568 | + $param = !empty($param) ? trim($param[0], '() ') : null; |
|
| 569 | 569 | |
| 570 | 570 | // Params can be separated by commas to allow multiple parameters for the filter |
| 571 | - if (! empty($param)) { |
|
| 571 | + if (!empty($param)) { |
|
| 572 | 572 | $param = explode(',', $param); |
| 573 | 573 | |
| 574 | 574 | // Clean it up |
@@ -580,10 +580,10 @@ discard block |
||
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | // Get our filter name |
| 583 | - $filter = ! empty($param) ? trim(strtolower(substr($filter, 0, strpos($filter, '(')))) : trim($filter); |
|
| 583 | + $filter = !empty($param) ? trim(strtolower(substr($filter, 0, strpos($filter, '(')))) : trim($filter); |
|
| 584 | 584 | |
| 585 | 585 | $this->config['filters'] ??= []; |
| 586 | - if (! array_key_exists($filter, $this->config['filters'])) { |
|
| 586 | + if (!array_key_exists($filter, $this->config['filters'])) { |
|
| 587 | 587 | continue; |
| 588 | 588 | } |
| 589 | 589 | |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | * $matches[1] = all parameters string in opening tag |
| 623 | 623 | * $matches[2] = content between the tags to send to the plugin. |
| 624 | 624 | */ |
| 625 | - if (! preg_match_all($pattern, $template, $matches, PREG_SET_ORDER)) { |
|
| 625 | + if (!preg_match_all($pattern, $template, $matches, PREG_SET_ORDER)) { |
|
| 626 | 626 | continue; |
| 627 | 627 | } |
| 628 | 628 | |
@@ -54,11 +54,11 @@ |
||
| 54 | 54 | |
| 55 | 55 | parent::initAnnotation($properties); |
| 56 | 56 | |
| 57 | - if ($this->min !== null && ! is_int($this->min) && ! is_float($this->min)) { |
|
| 57 | + if ($this->min !== null && !is_int($this->min) && !is_float($this->min)) { |
|
| 58 | 58 | throw new AnnotationException('RangeAnnotation requires a numeric (float or int) min property'); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - if ($this->max !== null && ! is_int($this->max) && ! is_float($this->max)) { |
|
| 61 | + if ($this->max !== null && !is_int($this->max) && !is_float($this->max)) { |
|
| 62 | 62 | throw new AnnotationException('RangeAnnotation requires a numeric (float or int) max property'); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function getValue() |
| 35 | 35 | { |
| 36 | - if (! empty($this->value)) { |
|
| 36 | + if (!empty($this->value)) { |
|
| 37 | 37 | return $this->value; |
| 38 | 38 | } |
| 39 | 39 | |