@@ -40,7 +40,7 @@ |
||
| 40 | 40 | { |
| 41 | 41 | helper('filesystem'); |
| 42 | 42 | |
| 43 | - if (! delete_files(FRAMEWORK_STORAGE_PATH . 'debugbar')) { |
|
| 43 | + if (!delete_files(FRAMEWORK_STORAGE_PATH . 'debugbar')) { |
|
| 44 | 44 | // @codeCoverageIgnoreStart |
| 45 | 45 | $this->error('Erreur lors de la suppression des fichiers de la debugbar.')->eol(); |
| 46 | 46 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | public static function setUpBeforeClass(): void |
| 26 | 26 | { |
| 27 | - if (! is_dir($dirname = pathinfo(static::$ou, PATHINFO_DIRNAME))) { |
|
| 27 | + if (!is_dir($dirname = pathinfo(static::$ou, PATHINFO_DIRNAME))) { |
|
| 28 | 28 | mkdir($dirname, 0o777, true); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | 'Sodium' => extension_loaded('sodium') && version_compare(SODIUM_LIBRARY_VERSION, '1.0.14', '>='), |
| 83 | 83 | ]; |
| 84 | 84 | |
| 85 | - if (! in_array($this->driver, $this->drivers, true) || (array_key_exists($this->driver, $this->handlers) && ! $this->handlers[$this->driver])) { |
|
| 85 | + if (!in_array($this->driver, $this->drivers, true) || (array_key_exists($this->driver, $this->handlers) && !$this->handlers[$this->driver])) { |
|
| 86 | 86 | throw EncryptionException::noHandlerAvailable($this->driver); |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | throw EncryptionException::noDriverRequested(); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if (! in_array($this->driver, $this->drivers, true)) { |
|
| 123 | + if (!in_array($this->driver, $this->drivers, true)) { |
|
| 124 | 124 | throw EncryptionException::unKnownHandler($this->driver); |
| 125 | 125 | } |
| 126 | 126 | |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | $data = self::substr($data, $hmacLength); |
| 126 | 126 | $hmacCalc = \hash_hmac($this->digest, $data, $authKey, $this->rawData); |
| 127 | 127 | |
| 128 | - if (! hash_equals($hmacKey, $hmacCalc)) { |
|
| 128 | + if (!hash_equals($hmacKey, $hmacCalc)) { |
|
| 129 | 129 | throw EncryptionException::authenticationFailed(); |
| 130 | 130 | } |
| 131 | 131 | |
@@ -11,10 +11,13 @@ discard block |
||
| 11 | 11 | use Psr\Http\Server\RequestHandlerInterface; |
| 12 | 12 | |
| 13 | 13 | class {class} extends BaseMiddleware implements MiddlewareInterface |
| 14 | -<?php else: ?> |
|
| 14 | +<?php else { |
|
| 15 | + : ?> |
|
| 15 | 16 | |
| 16 | 17 | class {class} extends BaseMiddleware |
| 17 | -<?php endif; ?> |
|
| 18 | +<?php endif; |
|
| 19 | +} |
|
| 20 | +?> |
|
| 18 | 21 | { |
| 19 | 22 | /** |
| 20 | 23 | * Traitez une demande de serveur entrante. |
@@ -26,16 +29,22 @@ discard block |
||
| 26 | 29 | */ |
| 27 | 30 | <?php if ($standard === 'psr15'): ?> |
| 28 | 31 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
| 29 | -<?php else: ?> |
|
| 32 | +<?php else { |
|
| 33 | + : ?> |
|
| 30 | 34 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface |
| 31 | -<?php endif; ?> |
|
| 35 | +<?php endif; |
|
| 36 | +} |
|
| 37 | +?> |
|
| 32 | 38 | { |
| 33 | 39 | // |
| 34 | 40 | |
| 35 | 41 | <?php if ($standard === 'psr15'): ?> |
| 36 | 42 | return $handler->handle($request); |
| 37 | -<?php else: ?> |
|
| 43 | +<?php else { |
|
| 44 | + : ?> |
|
| 38 | 45 | return $next($request, $response); |
| 39 | -<?php endif; ?> |
|
| 46 | +<?php endif; |
|
| 47 | +} |
|
| 48 | +?> |
|
| 40 | 49 | } |
| 41 | 50 | } |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | { |
| 79 | 79 | $standard = $this->option('standard', 'psr15'); |
| 80 | 80 | |
| 81 | - if (! in_array($standard, ['psr15', 'psr7'], true)) { |
|
| 81 | + if (!in_array($standard, ['psr15', 'psr7'], true)) { |
|
| 82 | 82 | // @codeCoverageIgnoreStart |
| 83 | 83 | $standard = $this->choice(lang('CLI.generator.middlewareStandard'), ['psr15', 'psr7'], 'psr15'); |
| 84 | 84 | $this->eol(); |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | class {class} extends {extends} |
| 8 | 8 | { |
| 9 | -<?php if (! empty($invokable)): ?> |
|
| 9 | +<?php if (!empty($invokable)): ?> |
|
| 10 | 10 | /** |
| 11 | 11 | * Traitement |
| 12 | 12 | * |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | use BlitzPHP\Utilities\String\Inflector; |
| 13 | 13 | use BlitzPHP\Utilities\String\Text; |
| 14 | 14 | |
| 15 | -if (! function_exists('camelize')) { |
|
| 15 | +if (!function_exists('camelize')) { |
|
| 16 | 16 | /** |
| 17 | 17 | * Camelize |
| 18 | 18 | * |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | -if (! function_exists('classify')) { |
|
| 29 | +if (!function_exists('classify')) { |
|
| 30 | 30 | /** |
| 31 | 31 | * Returns model class name ("Person" for the database table "people".) for given database table. |
| 32 | 32 | * |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -if (! function_exists('dasherize')) { |
|
| 43 | +if (!function_exists('dasherize')) { |
|
| 44 | 44 | /** |
| 45 | 45 | * Returns the input CamelCasedString as an dashed-string. |
| 46 | 46 | * |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | -if (! function_exists('delimit')) { |
|
| 59 | +if (!function_exists('delimit')) { |
|
| 60 | 60 | /** |
| 61 | 61 | * Expects a CamelCasedInputString, and produces a lower_case_delimited_string |
| 62 | 62 | * |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | -if (! function_exists('humanize')) { |
|
| 74 | +if (!function_exists('humanize')) { |
|
| 75 | 75 | /** |
| 76 | 76 | * Humanize |
| 77 | 77 | * |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | -if (! function_exists('plural')) { |
|
| 89 | +if (!function_exists('plural')) { |
|
| 90 | 90 | /** |
| 91 | 91 | * Plural |
| 92 | 92 | * |
@@ -96,30 +96,30 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | $result = $string; |
| 98 | 98 | |
| 99 | - if (! is_pluralizable($result)) { |
|
| 99 | + if (!is_pluralizable($result)) { |
|
| 100 | 100 | return $result; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $plural_rules = [ |
| 104 | - '/(quiz)$/' => '\1zes', // quizzes |
|
| 105 | - '/^(ox)$/' => '\1\2en', // ox |
|
| 106 | - '/([m|l])ouse$/' => '\1ice', // mouse, louse |
|
| 107 | - '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index |
|
| 108 | - '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address |
|
| 109 | - '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency |
|
| 110 | - '/(hive)$/' => '\1s', // archive, hive |
|
| 111 | - '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife |
|
| 112 | - '/sis$/' => 'ses', // basis, diagnosis |
|
| 113 | - '/([ti])um$/' => '\1a', // datum, medium |
|
| 114 | - '/(p)erson$/' => '\1eople', // person, salesperson |
|
| 115 | - '/(m)an$/' => '\1en', // man, woman, spokesman |
|
| 116 | - '/(c)hild$/' => '\1hildren', // child |
|
| 117 | - '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato |
|
| 118 | - '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
| 119 | - '/(alias|status|virus)$/' => '\1es', // alias |
|
| 120 | - '/(octop)us$/' => '\1i', // octopus |
|
| 121 | - '/(ax|cris|test)is$/' => '\1es', // axis, crisis |
|
| 122 | - '/s$/' => 's', // no change (compatibility) |
|
| 104 | + '/(quiz)$/' => '\1zes', // quizzes |
|
| 105 | + '/^(ox)$/' => '\1\2en', // ox |
|
| 106 | + '/([m|l])ouse$/' => '\1ice', // mouse, louse |
|
| 107 | + '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index |
|
| 108 | + '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address |
|
| 109 | + '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency |
|
| 110 | + '/(hive)$/' => '\1s', // archive, hive |
|
| 111 | + '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife |
|
| 112 | + '/sis$/' => 'ses', // basis, diagnosis |
|
| 113 | + '/([ti])um$/' => '\1a', // datum, medium |
|
| 114 | + '/(p)erson$/' => '\1eople', // person, salesperson |
|
| 115 | + '/(m)an$/' => '\1en', // man, woman, spokesman |
|
| 116 | + '/(c)hild$/' => '\1hildren', // child |
|
| 117 | + '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato |
|
| 118 | + '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
| 119 | + '/(alias|status|virus)$/' => '\1es', // alias |
|
| 120 | + '/(octop)us$/' => '\1i', // octopus |
|
| 121 | + '/(ax|cris|test)is$/' => '\1es', // axis, crisis |
|
| 122 | + '/s$/' => 's', // no change (compatibility) |
|
| 123 | 123 | '/$/' => 's', |
| 124 | 124 | ]; |
| 125 | 125 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | -if (! function_exists('pluralize')) { |
|
| 137 | +if (!function_exists('pluralize')) { |
|
| 138 | 138 | /** |
| 139 | 139 | * Return $word in plural form. |
| 140 | 140 | * |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | -if (! function_exists('singular')) { |
|
| 151 | +if (!function_exists('singular')) { |
|
| 152 | 152 | /** |
| 153 | 153 | * Singular |
| 154 | 154 | * |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | { |
| 159 | 159 | $result = $string; |
| 160 | 160 | |
| 161 | - if (! is_pluralizable($result)) { |
|
| 161 | + if (!is_pluralizable($result)) { |
|
| 162 | 162 | return $result; |
| 163 | 163 | } |
| 164 | 164 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | -if (! function_exists('singularize')) { |
|
| 207 | +if (!function_exists('singularize')) { |
|
| 208 | 208 | /** |
| 209 | 209 | * Return $word in singular form. |
| 210 | 210 | * |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | -if (! function_exists('tableize')) { |
|
| 221 | +if (!function_exists('tableize')) { |
|
| 222 | 222 | /** |
| 223 | 223 | * Returns corresponding table name for given model $className. ("people" for the model class "Person"). |
| 224 | 224 | * |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | -if (! function_exists('underscore')) { |
|
| 235 | +if (!function_exists('underscore')) { |
|
| 236 | 236 | /** |
| 237 | 237 | * Underscore |
| 238 | 238 | * |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | -if (! function_exists('variable')) { |
|
| 249 | +if (!function_exists('variable')) { |
|
| 250 | 250 | /** |
| 251 | 251 | * Returns camelBacked version of an underscored string. |
| 252 | 252 | * |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | -if (! function_exists('counted')) { |
|
| 263 | +if (!function_exists('counted')) { |
|
| 264 | 264 | /** |
| 265 | 265 | * Counted |
| 266 | 266 | * |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | -if (! function_exists('pascalize')) { |
|
| 281 | +if (!function_exists('pascalize')) { |
|
| 282 | 282 | /** |
| 283 | 283 | * Pascalize |
| 284 | 284 | * |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | } |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | -if (! function_exists('is_pluralizable')) { |
|
| 297 | +if (!function_exists('is_pluralizable')) { |
|
| 298 | 298 | /** |
| 299 | 299 | * Checks if the given word has a plural version. |
| 300 | 300 | * |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | function is_pluralizable(string $word): bool |
| 304 | 304 | { |
| 305 | - return ! in_array( |
|
| 305 | + return !in_array( |
|
| 306 | 306 | strtolower($word), |
| 307 | 307 | [ |
| 308 | 308 | 'advice', |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | -if (! function_exists('ordinal')) { |
|
| 380 | +if (!function_exists('ordinal')) { |
|
| 381 | 381 | /** |
| 382 | 382 | * Returns the suffix that should be added to a |
| 383 | 383 | * number to denote the position in an ordered |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | -if (! function_exists('ordinalize')) { |
|
| 407 | +if (!function_exists('ordinalize')) { |
|
| 408 | 408 | /** |
| 409 | 409 | * Turns a number into an ordinal string used |
| 410 | 410 | * to denote the position in an ordered sequence |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $response = $handler->handle($request); |
| 38 | 38 | $content = $response->getBody()->getContents(); |
| 39 | 39 | |
| 40 | - if (! $response instanceof Redirection) { |
|
| 40 | + if (!$response instanceof Redirection) { |
|
| 41 | 41 | // Mettez-le en cache sans remplacer les mesures de performances afin que nous puissions avoir des mises à jour de vitesse en direct en cours de route. |
| 42 | 42 | // Doit être exécuté après les filtres pour conserver les en-têtes de réponse. |
| 43 | 43 | $this->pageCache->make($request, $response->withBody(to_stream($content))); |