@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | // @codeCoverageIgnoreStart |
95 | 95 | $this->colorize(lang('CLI.generator.usingCINamespace'), 'yellow'); |
96 | 96 | |
97 | - if (! $this->confirm('Are you sure you want to continue?')) { |
|
97 | + if (!$this->confirm('Are you sure you want to continue?')) { |
|
98 | 98 | $this->eol(); |
99 | 99 | $this->colorize(lang('CLI.generator.cancelOperation'), 'yellow'); |
100 | 100 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | // Écraser des fichiers sans le savoir est une gêne sérieuse, nous allons donc vérifier si nous dupliquons des choses, |
122 | 122 | // si l'option "forcer" n'est pas fournie, nous renvoyons. |
123 | - if (! $this->getOption('force') && $isFile) { |
|
123 | + if (!$this->getOption('force') && $isFile) { |
|
124 | 124 | $this->io->error(lang('CLI.generator.fileExist', [clean_path($path)]), true); |
125 | 125 | |
126 | 126 | return; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | // Vérifie si le répertoire pour enregistrer le fichier existe. |
130 | 130 | $dir = dirname($path); |
131 | 131 | |
132 | - if (! is_dir($dir)) { |
|
132 | + if (!is_dir($dir)) { |
|
133 | 133 | mkdir($dir, 0755, true); |
134 | 134 | } |
135 | 135 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | // Construisez la classe en fonction des détails dont nous disposons. |
139 | 139 | // Nous obtiendrons le contenu de notre fichier à partir du modèle, |
140 | 140 | // puis nous effectuerons les remplacements nécessaires. |
141 | - if (! write_file($path, $this->buildContent($class))) { |
|
141 | + if (!write_file($path, $this->buildContent($class))) { |
|
142 | 142 | // @codeCoverageIgnoreStart |
143 | 143 | $this->io->error(lang('CLI.generator.fileError', [clean_path($path)]), true); |
144 | 144 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $class = $matches[1] . ucfirst($matches[2]); |
203 | 203 | } |
204 | 204 | |
205 | - if ($this->enabledSuffixing && $this->getOption('suffix') && ! strripos($class, $component)) { |
|
205 | + if ($this->enabledSuffixing && $this->getOption('suffix') && !strripos($class, $component)) { |
|
206 | 206 | $class .= ucfirst($component); |
207 | 207 | } |
208 | 208 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public static function instance() |
39 | 39 | { |
40 | - if (! (static::$_instance instanceof static)) { |
|
40 | + if (!(static::$_instance instanceof static)) { |
|
41 | 41 | $params = func_get_args(); |
42 | 42 | static::$_instance = new static(...$params); |
43 | 43 | } |
@@ -80,49 +80,49 @@ discard block |
||
80 | 80 | */ |
81 | 81 | defined('LAYOUT_PATH') || define('LAYOUT_PATH', VIEW_PATH . 'layouts' . DS); |
82 | 82 | |
83 | -if (! defined('SERVICE_PATH')) { |
|
83 | +if (!defined('SERVICE_PATH')) { |
|
84 | 84 | /** |
85 | 85 | * Services directory path |
86 | 86 | */ |
87 | 87 | define('SERVICE_PATH', APP_PATH . 'services' . DS); |
88 | 88 | } |
89 | 89 | |
90 | -if (! defined('LOG_PATH')) { |
|
90 | +if (!defined('LOG_PATH')) { |
|
91 | 91 | /** |
92 | 92 | * Application logs files storage path |
93 | 93 | */ |
94 | 94 | define('LOG_PATH', STORAGE_PATH . 'logs' . DS); |
95 | 95 | } |
96 | 96 | |
97 | -if (! defined('DATABASE_PATH')) { |
|
97 | +if (!defined('DATABASE_PATH')) { |
|
98 | 98 | /** |
99 | 99 | * Database storage directory path |
100 | 100 | */ |
101 | 101 | define('DATABASE_PATH', STORAGE_PATH . 'database' . DS); |
102 | 102 | } |
103 | 103 | |
104 | -if (! defined('DB_MIGRATION_PATH')) { |
|
104 | +if (!defined('DB_MIGRATION_PATH')) { |
|
105 | 105 | /** |
106 | 106 | * Database migrations storage path |
107 | 107 | */ |
108 | 108 | define('DB_MIGRATION_PATH', RESOURCE_PATH . 'database' . DS . 'migrations' . DS); |
109 | 109 | } |
110 | 110 | |
111 | -if (! defined('DB_SEED_PATH')) { |
|
111 | +if (!defined('DB_SEED_PATH')) { |
|
112 | 112 | /** |
113 | 113 | * Database seeds storage path |
114 | 114 | */ |
115 | 115 | define('DB_SEED_PATH', RESOURCE_PATH . 'database' . DS . 'seeds' . DS); |
116 | 116 | } |
117 | 117 | |
118 | -if (! defined('DB_DUMP_PATH')) { |
|
118 | +if (!defined('DB_DUMP_PATH')) { |
|
119 | 119 | /** |
120 | 120 | * Database backup storage path |
121 | 121 | */ |
122 | 122 | define('DB_DUMP_PATH', DATABASE_PATH . 'dump' . DS); |
123 | 123 | } |
124 | 124 | |
125 | -if (! defined('DB_CACHE_PATH')) { |
|
125 | +if (!defined('DB_CACHE_PATH')) { |
|
126 | 126 | /** |
127 | 127 | * Database cache directory path |
128 | 128 | */ |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | */ |
145 | 145 | defined('SECOND') || define('SECOND', 1); |
146 | 146 | defined('MINUTE') || define('MINUTE', 60); |
147 | -defined('HOUR') || define('HOUR', 3600); |
|
148 | -defined('DAY') || define('DAY', 86400); |
|
149 | -defined('WEEK') || define('WEEK', 604800); |
|
150 | -defined('MONTH') || define('MONTH', 2592000); |
|
151 | -defined('YEAR') || define('YEAR', 31536000); |
|
147 | +defined('HOUR') || define('HOUR', 3600); |
|
148 | +defined('DAY') || define('DAY', 86400); |
|
149 | +defined('WEEK') || define('WEEK', 604800); |
|
150 | +defined('MONTH') || define('MONTH', 2592000); |
|
151 | +defined('YEAR') || define('YEAR', 31536000); |
|
152 | 152 | defined('DECADE') || define('DECADE', 315360000); |
153 | 153 | |
154 | 154 | /** |
@@ -169,13 +169,13 @@ discard block |
||
169 | 169 | * - BSD sysexits.h: http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits |
170 | 170 | * - Bash scripting: http://tldp.org/LDP/abs/html/exitcodes.html |
171 | 171 | */ |
172 | -defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // pas d'erreurs |
|
173 | -defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // erreur generique |
|
174 | -defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // erreur de configuration |
|
175 | -defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // fichier non trouvé |
|
176 | -defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // classe inconnue |
|
172 | +defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // pas d'erreurs |
|
173 | +defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // erreur generique |
|
174 | +defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // erreur de configuration |
|
175 | +defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // fichier non trouvé |
|
176 | +defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // classe inconnue |
|
177 | 177 | defined('EXIT_UNKNOWN_METHOD') || define('EXIT_UNKNOWN_METHOD', 6); // membre de classe inconnu |
178 | -defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // saisie utilisateur invalide |
|
179 | -defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // erreur de base de données |
|
180 | -defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // code d'erreur attribué automatiquement le plus bas |
|
181 | -defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // code d'erreur attribué automatiquement le plus élevé |
|
178 | +defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // saisie utilisateur invalide |
|
179 | +defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // erreur de base de données |
|
180 | +defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // code d'erreur attribué automatiquement le plus bas |
|
181 | +defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // code d'erreur attribué automatiquement le plus élevé |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | use InvalidArgumentException; |
16 | 16 | use Transliterator; |
17 | 17 | |
18 | -if (! defined('MB_ENABLED')) { |
|
18 | +if (!defined('MB_ENABLED')) { |
|
19 | 19 | if (extension_loaded('mbstring')) { |
20 | 20 | define('MB_ENABLED', true); |
21 | 21 | // mbstring.internal_encoding est obsolète à partir de PHP 5.6 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | define('MB_ENABLED', false); |
29 | 29 | } |
30 | 30 | } |
31 | -if (! defined('ICONV_ENABLED')) { |
|
31 | +if (!defined('ICONV_ENABLED')) { |
|
32 | 32 | if (extension_loaded('iconv')) { |
33 | 33 | define('ICONV_ENABLED', true); |
34 | 34 | // iconv.internal_encoding est obsolète à partir de PHP 5.6 |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $converter = preg_replace('#Case$#i', '', $converter); |
108 | 108 | $converter = str_replace('to', '', strtolower($converter)); |
109 | 109 | |
110 | - if (! in_array($converter, $available_case, true)) { |
|
110 | + if (!in_array($converter, $available_case, true)) { |
|
111 | 111 | throw new InvalidArgumentException("Invalid converter type: `{$converter}`"); |
112 | 112 | } |
113 | 113 | |
@@ -160,13 +160,13 @@ discard block |
||
160 | 160 | public static function cleanInsert(string $str, array $options): string |
161 | 161 | { |
162 | 162 | $clean = $options['clean']; |
163 | - if (! $clean) { |
|
163 | + if (!$clean) { |
|
164 | 164 | return $str; |
165 | 165 | } |
166 | 166 | if ($clean === true) { |
167 | 167 | $clean = ['method' => 'text']; |
168 | 168 | } |
169 | - if (! is_array($clean)) { |
|
169 | + if (!is_array($clean)) { |
|
170 | 170 | $clean = ['method' => $options['clean']]; |
171 | 171 | } |
172 | 172 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | public static function containsAll(string $haystack, array $needles): bool |
260 | 260 | { |
261 | 261 | foreach ($needles as $needle) { |
262 | - if (! static::contains($haystack, $needle)) { |
|
262 | + if (!static::contains($haystack, $needle)) { |
|
263 | 263 | return false; |
264 | 264 | } |
265 | 265 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | return $options['clean'] ? static::cleanInsert($str, $options) : $str; |
460 | 460 | } |
461 | 461 | |
462 | - if (! isset($format)) { |
|
462 | + if (!isset($format)) { |
|
463 | 463 | $format = sprintf( |
464 | 464 | '/(?<!%s)%s%%s%s/', |
465 | 465 | preg_quote($options['escape'], '/'), |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | $str = str_replace($tmpHash, $tmpValue, $str); |
497 | 497 | } |
498 | 498 | |
499 | - if (! isset($options['format']) && isset($options['before'])) { |
|
499 | + if (!isset($options['format']) && isset($options['before'])) { |
|
500 | 500 | $str = str_replace($options['escape'] . $options['before'], $options['before'], $str); |
501 | 501 | } |
502 | 502 | |
@@ -797,8 +797,8 @@ discard block |
||
797 | 797 | $pattern = '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i'; |
798 | 798 | $replace = preg_replace_callback( |
799 | 799 | $pattern, |
800 | - static function ($match) use ($strlen) { |
|
801 | - $utf8 = html_entity_decode($match[0], ENT_HTML5 | ENT_QUOTES, 'UTF-8'); |
|
800 | + static function($match) use ($strlen) { |
|
801 | + $utf8 = html_entity_decode($match[0], ENT_HTML5|ENT_QUOTES, 'UTF-8'); |
|
802 | 802 | |
803 | 803 | return str_repeat(' ', $strlen($utf8, 'UTF-8')); |
804 | 804 | }, |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | $result = ''; |
859 | 859 | |
860 | 860 | $pattern = '/(&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};)/i'; |
861 | - $parts = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
|
861 | + $parts = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); |
|
862 | 862 | |
863 | 863 | foreach ($parts as $part) { |
864 | 864 | $offset = 0; |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | if ($offset !== 0 || $totalLength + $len > $length) { |
880 | 880 | if ( |
881 | 881 | strpos($part, '&') === 0 && preg_match($pattern, $part) |
882 | - && $part !== html_entity_decode($part, ENT_HTML5 | ENT_QUOTES, 'UTF-8') |
|
882 | + && $part !== html_entity_decode($part, ENT_HTML5|ENT_QUOTES, 'UTF-8') |
|
883 | 883 | ) { |
884 | 884 | // Entities cannot be passed substr. |
885 | 885 | continue; |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | } |
935 | 935 | |
936 | 936 | $truncate = mb_substr($text, mb_strlen($text) - $length + mb_strlen($ellipsis)); |
937 | - if (! $exact) { |
|
937 | + if (!$exact) { |
|
938 | 938 | $spacepos = mb_strpos($truncate, ' '); |
939 | 939 | $truncate = $spacepos === false ? '' : trim(mb_substr($truncate, $spacepos)); |
940 | 940 | } |
@@ -989,7 +989,7 @@ discard block |
||
989 | 989 | } |
990 | 990 | if ($tmpOffset !== -1) { |
991 | 991 | $buffer .= substr($data, $offset, ($tmpOffset - $offset)); |
992 | - if (! $depth && $data[$tmpOffset] === $separator) { |
|
992 | + if (!$depth && $data[$tmpOffset] === $separator) { |
|
993 | 993 | $results[] = $buffer; |
994 | 994 | $buffer = ''; |
995 | 995 | } else { |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | } |
1005 | 1005 | } else { |
1006 | 1006 | if ($data[$tmpOffset] === $leftBound) { |
1007 | - if (! $open) { |
|
1007 | + if (!$open) { |
|
1008 | 1008 | $depth++; |
1009 | 1009 | $open = true; |
1010 | 1010 | } else { |
@@ -1018,11 +1018,11 @@ discard block |
||
1018 | 1018 | $offset = $length + 1; |
1019 | 1019 | } |
1020 | 1020 | } |
1021 | - if (empty($results) && ! empty($buffer)) { |
|
1021 | + if (empty($results) && !empty($buffer)) { |
|
1022 | 1022 | $results[] = $buffer; |
1023 | 1023 | } |
1024 | 1024 | |
1025 | - if (! empty($results)) { |
|
1025 | + if (!empty($results)) { |
|
1026 | 1026 | return array_map('trim', $results); |
1027 | 1027 | } |
1028 | 1028 | |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | */ |
1063 | 1063 | public static function transliterate(string $string, $transliterator = null) |
1064 | 1064 | { |
1065 | - if (! $transliterator) { |
|
1065 | + if (!$transliterator) { |
|
1066 | 1066 | $transliterator = static::$_defaultTransliterator ?: static::$_defaultTransliteratorId; |
1067 | 1067 | } |
1068 | 1068 | |
@@ -1093,7 +1093,7 @@ discard block |
||
1093 | 1093 | $default = [ |
1094 | 1094 | 'ellipsis' => '...', 'exact' => true, 'html' => false, 'trimWidth' => false, |
1095 | 1095 | ]; |
1096 | - if (! empty($options['html']) && strtolower(mb_internal_encoding()) === 'utf-8') { |
|
1096 | + if (!empty($options['html']) && strtolower(mb_internal_encoding()) === 'utf-8') { |
|
1097 | 1097 | $default['ellipsis'] = "\xe2\x80\xa6"; |
1098 | 1098 | } |
1099 | 1099 | $options += $default; |
@@ -1113,12 +1113,12 @@ discard block |
||
1113 | 1113 | |
1114 | 1114 | foreach ($tags as $tag) { |
1115 | 1115 | $contentLength = 0; |
1116 | - if (! in_array($tag[2], static::$_defaultHtmlNoCount, true)) { |
|
1116 | + if (!in_array($tag[2], static::$_defaultHtmlNoCount, true)) { |
|
1117 | 1117 | $contentLength = self::strlen($tag[3], $options); |
1118 | 1118 | } |
1119 | 1119 | |
1120 | 1120 | if ($truncate === '') { |
1121 | - if (! preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/i', $tag[2])) { |
|
1121 | + if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/i', $tag[2])) { |
|
1122 | 1122 | if (preg_match('/<[\w]+[^>]*>/', $tag[0])) { |
1123 | 1123 | array_unshift($openTags, $tag[2]); |
1124 | 1124 | } elseif (preg_match('/<\/([\w]+)[^>]*>/', $tag[0], $closeTag)) { |
@@ -1164,13 +1164,13 @@ discard block |
||
1164 | 1164 | |
1165 | 1165 | $result = self::substr($text, 0, $length - $ellipsisLength, $options); |
1166 | 1166 | |
1167 | - if (! $options['exact']) { |
|
1167 | + if (!$options['exact']) { |
|
1168 | 1168 | if (self::substr($text, $length - $ellipsisLength, 1, $options) !== ' ') { |
1169 | 1169 | $result = self::removeLastWord($result); |
1170 | 1170 | } |
1171 | 1171 | |
1172 | 1172 | // If result is empty, then we don't need to count ellipsis in the cut. |
1173 | - if (! strlen($result)) { |
|
1173 | + if (!strlen($result)) { |
|
1174 | 1174 | $result = self::substr($text, 0, $length, $options); |
1175 | 1175 | } |
1176 | 1176 | } |
@@ -1201,7 +1201,7 @@ discard block |
||
1201 | 1201 | { |
1202 | 1202 | preg_match('/^\s*+(?:\S++\s*+){1,' . $words . '}/u', $value, $matches); |
1203 | 1203 | |
1204 | - if (! isset($matches[0]) || static::length($value) === static::length($matches[0])) { |
|
1204 | + if (!isset($matches[0]) || static::length($value) === static::length($matches[0])) { |
|
1205 | 1205 | return $value; |
1206 | 1206 | } |
1207 | 1207 | |
@@ -1351,7 +1351,7 @@ discard block |
||
1351 | 1351 | { |
1352 | 1352 | static $languageSpecific; |
1353 | 1353 | |
1354 | - if (! isset($languageSpecific)) { |
|
1354 | + if (!isset($languageSpecific)) { |
|
1355 | 1355 | $languageSpecific = [ |
1356 | 1356 | 'bg' => [ |
1357 | 1357 | ['х', 'Х', 'щ', 'Щ', 'ъ', 'Ъ', 'ь', 'Ь'], |
@@ -1362,7 +1362,7 @@ discard block |
||
1362 | 1362 | ['ae', 'oe', 'aa', 'Ae', 'Oe', 'Aa'], |
1363 | 1363 | ], |
1364 | 1364 | 'de' => [ |
1365 | - ['ä', 'ö', 'ü', 'Ä', 'Ö', 'Ü'], |
|
1365 | + ['ä', 'ö', 'ü', 'Ä', 'Ö', 'Ü'], |
|
1366 | 1366 | ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'], |
1367 | 1367 | ], |
1368 | 1368 | 'he' => [ |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | '/us$/i' => 'uses', |
46 | 46 | '/(alias)$/i' => '\1es', |
47 | 47 | '/(ax|cris|test)is$/i' => '\1es', |
48 | - '/(m)an$/' => '\1en', // man, woman, spokesman |
|
49 | - '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
50 | - '/(octop)us$/' => '\1i', // octopus |
|
48 | + '/(m)an$/' => '\1en', // man, woman, spokesman |
|
49 | + '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
50 | + '/(octop)us$/' => '\1i', // octopus |
|
51 | 51 | '/s$/' => 's', |
52 | 52 | '/^$/' => '', |
53 | 53 | '/$/' => 's', |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | |
433 | 433 | return $value; |
434 | 434 | } |
435 | - if (! isset(static::$_cache[$type][$key])) { |
|
435 | + if (!isset(static::$_cache[$type][$key])) { |
|
436 | 436 | return false; |
437 | 437 | } |
438 | 438 | |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | return static::$_cache['pluralize'][$word]; |
513 | 513 | } |
514 | 514 | |
515 | - if (! isset(static::$_cache['irregular']['pluralize'])) { |
|
515 | + if (!isset(static::$_cache['irregular']['pluralize'])) { |
|
516 | 516 | static::$_cache['irregular']['pluralize'] = '(?:' . implode('|', array_keys(static::$_irregular)) . ')'; |
517 | 517 | } |
518 | 518 | |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | return static::$_cache['pluralize'][$word]; |
524 | 524 | } |
525 | 525 | |
526 | - if (! isset(static::$_cache['uninflected'])) { |
|
526 | + if (!isset(static::$_cache['uninflected'])) { |
|
527 | 527 | static::$_cache['uninflected'] = '(?:' . implode('|', static::$_uninflected) . ')'; |
528 | 528 | } |
529 | 529 | |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | return static::$_cache['singularize'][$word]; |
558 | 558 | } |
559 | 559 | |
560 | - if (! isset(static::$_cache['irregular']['singular'])) { |
|
560 | + if (!isset(static::$_cache['irregular']['singular'])) { |
|
561 | 561 | static::$_cache['irregular']['singular'] = '(?:' . implode('|', static::$_irregular) . ')'; |
562 | 562 | } |
563 | 563 | |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | return static::$_cache['singularize'][$word]; |
569 | 569 | } |
570 | 570 | |
571 | - if (! isset(static::$_cache['uninflected'])) { |
|
571 | + if (!isset(static::$_cache['uninflected'])) { |
|
572 | 572 | static::$_cache['uninflected'] = '(?:' . implode('|', static::$_uninflected) . ')'; |
573 | 573 | } |
574 | 574 |
@@ -39,16 +39,16 @@ discard block |
||
39 | 39 | |
40 | 40 | // services système |
41 | 41 | $filename = SYST_PATH . 'Constants' . DS . 'providers.php'; |
42 | - if (! file_exists($filename)) { |
|
42 | + if (!file_exists($filename)) { |
|
43 | 43 | throw LoadException::providersDefinitionDontExist($filename); |
44 | 44 | } |
45 | - if (! in_array($filename, get_included_files(), true)) { |
|
45 | + if (!in_array($filename, get_included_files(), true)) { |
|
46 | 46 | $providers = array_merge($providers, require $filename); |
47 | 47 | } |
48 | 48 | |
49 | 49 | // services de l'application |
50 | 50 | $filename = CONFIG_PATH . 'providers.php'; |
51 | - if (file_exists($filename) && ! in_array($filename, get_included_files(), true)) { |
|
51 | + if (file_exists($filename) && !in_array($filename, get_included_files(), true)) { |
|
52 | 52 | $providers = array_merge($providers, require $filename); |
53 | 53 | } |
54 | 54 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | return $models; |
98 | 98 | } |
99 | 99 | |
100 | - if (! self::isLoaded('models', $model)) { |
|
100 | + if (!self::isLoaded('models', $model)) { |
|
101 | 101 | self::loaded('models', $model, FileLocator::model($model, $options, $connection)); |
102 | 102 | } |
103 | 103 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $locale ??= config('app.language'); |
113 | 113 | |
114 | - if (! self::isLoaded('langs', $file . $locale)) { |
|
114 | + if (!self::isLoaded('langs', $file . $locale)) { |
|
115 | 115 | self::loaded('langs', $file . $locale, FileLocator::lang($file, $locale)); |
116 | 116 | } |
117 | 117 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | private static function isLoaded(string $module, $element): bool |
127 | 127 | { |
128 | - if (! isset(self::$loads[$module]) || ! is_array(self::$loads[$module])) { |
|
128 | + if (!isset(self::$loads[$module]) || !is_array(self::$loads[$module])) { |
|
129 | 129 | return false; |
130 | 130 | } |
131 | 131 |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | $this->getModel(); |
93 | 93 | |
94 | - if (! empty($this->helpers)) { |
|
94 | + if (!empty($this->helpers)) { |
|
95 | 95 | helper($this->helpers); |
96 | 96 | } |
97 | 97 | } |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | $this->modelName = is_object($which) ? null : $which; |
110 | 110 | } |
111 | 111 | |
112 | - if (empty($this->model) && ! empty($this->modelName) && class_exists($this->modelName)) { |
|
112 | + if (empty($this->model) && !empty($this->modelName) && class_exists($this->modelName)) { |
|
113 | 113 | $this->model = model($this->modelName); |
114 | 114 | } |
115 | 115 | |
116 | - if (! empty($this->model) && empty($this->modelName)) { |
|
116 | + if (!empty($this->model) && empty($this->modelName)) { |
|
117 | 117 | $this->modelName = get_class($this->model); |
118 | 118 | } |
119 | 119 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | private function getModel() |
153 | 153 | { |
154 | - if (! empty($this->modelName)) { |
|
154 | + if (!empty($this->modelName)) { |
|
155 | 155 | $model = $this->modelName; |
156 | 156 | } else { |
157 | 157 | $model = str_replace('Controller', 'Model', static::class); |
@@ -152,19 +152,19 @@ |
||
152 | 152 | */ |
153 | 153 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
154 | 154 | { |
155 | - if (! in_array($request->getMethod(), $this->methods, true)) { |
|
155 | + if (!in_array($request->getMethod(), $this->methods, true)) { |
|
156 | 156 | return $handler->handle($request); |
157 | 157 | } |
158 | 158 | |
159 | 159 | [$type] = explode(';', $request->getHeaderLine('Content-Type')); |
160 | 160 | $type = strtolower($type); |
161 | - if (! isset($this->parsers[$type])) { |
|
161 | + if (!isset($this->parsers[$type])) { |
|
162 | 162 | return $handler->handle($request); |
163 | 163 | } |
164 | 164 | |
165 | 165 | $parser = $this->parsers[$type]; |
166 | 166 | $result = $parser($request->getBody()->getContents()); |
167 | - if (! is_array($result)) { |
|
167 | + if (!is_array($result)) { |
|
168 | 168 | throw HttpException::badRequest(); |
169 | 169 | } |
170 | 170 | $request = $request->withParsedBody($result); |
@@ -63,12 +63,12 @@ |
||
63 | 63 | $group = on_test() ? 'test' : (on_prod() ? 'production' : 'development'); |
64 | 64 | } |
65 | 65 | |
66 | - if (! isset($config[$group])) { |
|
66 | + if (!isset($config[$group])) { |
|
67 | 67 | $group = 'default'; |
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | - if (is_string($group) && ! isset($config[$group]) && strpos($group, 'custom-') !== 0) { |
|
71 | + if (is_string($group) && !isset($config[$group]) && strpos($group, 'custom-') !== 0) { |
|
72 | 72 | throw new InvalidArgumentException($group . ' is not a valid database connection group.'); |
73 | 73 | } |
74 | 74 |