@@ -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 | * |
@@ -100,30 +100,30 @@ discard block |
||
100 | 100 | { |
101 | 101 | $result = (string) $str; |
102 | 102 | |
103 | - if (! is_countable($result)) { |
|
103 | + if (!is_countable($result)) { |
|
104 | 104 | return $result; |
105 | 105 | } |
106 | 106 | |
107 | 107 | $plural_rules = [ |
108 | - '/(quiz)$/' => '\1zes', // quizzes |
|
109 | - '/^(ox)$/' => '\1\2en', // ox |
|
110 | - '/([m|l])ouse$/' => '\1ice', // mouse, louse |
|
111 | - '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index |
|
112 | - '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address |
|
113 | - '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency |
|
114 | - '/(hive)$/' => '\1s', // archive, hive |
|
115 | - '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife |
|
116 | - '/sis$/' => 'ses', // basis, diagnosis |
|
117 | - '/([ti])um$/' => '\1a', // datum, medium |
|
118 | - '/(p)erson$/' => '\1eople', // person, salesperson |
|
119 | - '/(m)an$/' => '\1en', // man, woman, spokesman |
|
120 | - '/(c)hild$/' => '\1hildren', // child |
|
121 | - '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato |
|
122 | - '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
123 | - '/(alias|status|virus)$/' => '\1es', // alias |
|
124 | - '/(octop)us$/' => '\1i', // octopus |
|
125 | - '/(ax|cris|test)is$/' => '\1es', // axis, crisis |
|
126 | - '/s$/' => 's', // no change (compatibility) |
|
108 | + '/(quiz)$/' => '\1zes', // quizzes |
|
109 | + '/^(ox)$/' => '\1\2en', // ox |
|
110 | + '/([m|l])ouse$/' => '\1ice', // mouse, louse |
|
111 | + '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index |
|
112 | + '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address |
|
113 | + '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency |
|
114 | + '/(hive)$/' => '\1s', // archive, hive |
|
115 | + '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife |
|
116 | + '/sis$/' => 'ses', // basis, diagnosis |
|
117 | + '/([ti])um$/' => '\1a', // datum, medium |
|
118 | + '/(p)erson$/' => '\1eople', // person, salesperson |
|
119 | + '/(m)an$/' => '\1en', // man, woman, spokesman |
|
120 | + '/(c)hild$/' => '\1hildren', // child |
|
121 | + '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato |
|
122 | + '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
123 | + '/(alias|status|virus)$/' => '\1es', // alias |
|
124 | + '/(octop)us$/' => '\1i', // octopus |
|
125 | + '/(ax|cris|test)is$/' => '\1es', // axis, crisis |
|
126 | + '/s$/' => 's', // no change (compatibility) |
|
127 | 127 | '/$/' => 's', |
128 | 128 | ]; |
129 | 129 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | -if (! function_exists('pluralize')) { |
|
141 | +if (!function_exists('pluralize')) { |
|
142 | 142 | /** |
143 | 143 | * Return $word in plural form. |
144 | 144 | * |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
155 | -if (! function_exists('singular')) { |
|
155 | +if (!function_exists('singular')) { |
|
156 | 156 | /** |
157 | 157 | * Singular |
158 | 158 | * |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | { |
167 | 167 | $result = (string) $str; |
168 | 168 | |
169 | - if (! is_countable($result)) { |
|
169 | + if (!is_countable($result)) { |
|
170 | 170 | return $result; |
171 | 171 | } |
172 | 172 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
215 | -if (! function_exists('singularize')) { |
|
215 | +if (!function_exists('singularize')) { |
|
216 | 216 | /** |
217 | 217 | * Return $word in singular form. |
218 | 218 | * |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | } |
227 | 227 | } |
228 | 228 | |
229 | -if (! function_exists('tableize')) { |
|
229 | +if (!function_exists('tableize')) { |
|
230 | 230 | /** |
231 | 231 | * Returns corresponding table name for given model $className. ("people" for the model class "Person"). |
232 | 232 | * |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
243 | -if (! function_exists('underscore')) { |
|
243 | +if (!function_exists('underscore')) { |
|
244 | 244 | /** |
245 | 245 | * Underscore |
246 | 246 | * |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | } |
255 | 255 | } |
256 | 256 | |
257 | -if (! function_exists('variable')) { |
|
257 | +if (!function_exists('variable')) { |
|
258 | 258 | /** |
259 | 259 | * Returns camelBacked version of an underscored string. |
260 | 260 | * |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | } |
269 | 269 | } |
270 | 270 | |
271 | -if (! function_exists('counted')) { |
|
271 | +if (!function_exists('counted')) { |
|
272 | 272 | /** |
273 | 273 | * Counted |
274 | 274 | * |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | } |
287 | 287 | } |
288 | 288 | |
289 | -if (! function_exists('pascalize')) { |
|
289 | +if (!function_exists('pascalize')) { |
|
290 | 290 | /** |
291 | 291 | * Pascalize |
292 | 292 | * |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | } |
303 | 303 | } |
304 | 304 | |
305 | -if (! function_exists('is_pluralizable')) { |
|
305 | +if (!function_exists('is_pluralizable')) { |
|
306 | 306 | /** |
307 | 307 | * Checks if the given word has a plural version. |
308 | 308 | * |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | function is_pluralizable(string $word): bool |
312 | 312 | { |
313 | - return ! in_array( |
|
313 | + return !in_array( |
|
314 | 314 | strtolower($word), |
315 | 315 | [ |
316 | 316 | 'advice', |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | } |
386 | 386 | } |
387 | 387 | |
388 | -if (! function_exists('ordinal')) { |
|
388 | +if (!function_exists('ordinal')) { |
|
389 | 389 | /** |
390 | 390 | * Returns the suffix that should be added to a |
391 | 391 | * number to denote the position in an ordered |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | } |
413 | 413 | } |
414 | 414 | |
415 | -if (! function_exists('ordinalize')) { |
|
415 | +if (!function_exists('ordinalize')) { |
|
416 | 416 | /** |
417 | 417 | * Turns a number into an ordinal string used |
418 | 418 | * to denote the position in an ordered sequence |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | $this->adapter->addData($data, $context); |
152 | 152 | |
153 | - if (! array_key_exists('errors', $this->getData())) { |
|
153 | + if (!array_key_exists('errors', $this->getData())) { |
|
154 | 154 | $this->setValidationErrors(); |
155 | 155 | } |
156 | 156 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | $this->adapter->setData($data, $context); |
196 | 196 | |
197 | - if (! array_key_exists('errors', $this->getData())) { |
|
197 | + if (!array_key_exists('errors', $this->getData())) { |
|
198 | 198 | $this->setValidationErrors(); |
199 | 199 | } |
200 | 200 | |
@@ -234,10 +234,10 @@ discard block |
||
234 | 234 | */ |
235 | 235 | public function setAdapter(string $adapter, array $config = []): self |
236 | 236 | { |
237 | - if (! array_key_exists($adapter, self::$validAdapters)) { |
|
237 | + if (!array_key_exists($adapter, self::$validAdapters)) { |
|
238 | 238 | $adapter = 'native'; |
239 | 239 | } |
240 | - if (empty($this->config['adapters']) || ! is_array($this->config['adapters'])) { |
|
240 | + if (empty($this->config['adapters']) || !is_array($this->config['adapters'])) { |
|
241 | 241 | $this->config['adapters'] = []; |
242 | 242 | } |
243 | 243 |
@@ -66,14 +66,14 @@ |
||
66 | 66 | |
67 | 67 | $directory = dirname($path); |
68 | 68 | |
69 | - if (! is_dir($directory)) { |
|
69 | + if (!is_dir($directory)) { |
|
70 | 70 | mkdir($directory, 0777, true); |
71 | 71 | } |
72 | 72 | |
73 | 73 | if (file_exists($path)) { |
74 | 74 | $overwrite = (bool) $this->option('f'); |
75 | 75 | |
76 | - if (! $overwrite && ! $this->confirm("Le fichier '{$cleanPath}' existe déjà dans la destination. Le remplacé?")) { |
|
76 | + if (!$overwrite && !$this->confirm("Le fichier '{$cleanPath}' existe déjà dans la destination. Le remplacé?")) { |
|
77 | 77 | $this->error("{$cleanPath} sauté. Si vous souhaitez le remplacer, s'il vous plaît utiliser l'option '-f' ou répondre 'y' à l'invite.")->eol(); |
78 | 78 | |
79 | 79 | return; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | </span> |
43 | 43 | |
44 | 44 | <?php foreach ($collectors as $c) : ?> |
45 | - <?php if (! $c['isEmpty'] && ($c['hasTabContent'] || $c['hasLabel'])) : ?> |
|
45 | + <?php if (!$c['isEmpty'] && ($c['hasTabContent'] || $c['hasLabel'])) : ?> |
|
46 | 46 | <span class="blitzphp-label"> |
47 | 47 | <a href="javascript: void(0)" data-tab="blitzphp-<?= $c['key'] ?>"> |
48 | 48 | <img src="<?= $c['icon'] ?>"> |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | <!-- Collector-provided Tabs --> |
104 | 104 | <?php foreach ($collectors as $c) : ?> |
105 | - <?php if (! $c['isEmpty']) : ?> |
|
105 | + <?php if (!$c['isEmpty']) : ?> |
|
106 | 106 | <?php if ($c['hasTabContent']) : ?> |
107 | 107 | <div id="blitzphp-<?= $c['key'] ?>" class="tab"> |
108 | 108 | <h2><?= $c['title'] ?> <span><?= $c['titleDetails'] ?></span></h2> |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | </a> |
150 | 150 | |
151 | 151 | <?php if (isset($vars['session'])) : ?> |
152 | - <?php if (! empty($vars['session'])) : ?> |
|
152 | + <?php if (!empty($vars['session'])) : ?> |
|
153 | 153 | <table id="session_table"> |
154 | 154 | <tbody> |
155 | 155 | <?php foreach ($vars['session'] as $key => $value) : ?> |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | </span> |
43 | 43 | |
44 | 44 | <?php foreach ($collectors as $c) : ?> |
45 | - <?php if (! $c['isEmpty'] && ($c['hasTabContent'] || $c['hasLabel'])) : ?> |
|
45 | + <?php if (!$c['isEmpty'] && ($c['hasTabContent'] || $c['hasLabel'])) : ?> |
|
46 | 46 | <span class="blitzphp-label"> |
47 | 47 | <a href="javascript: void(0)" data-tab="blitzphp-<?= $c['key'] ?>"> |
48 | 48 | <img src="<?= $c['icon'] ?>"> |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | <!-- Collector-provided Tabs --> |
104 | 104 | <?php foreach ($collectors as $c) : ?> |
105 | - <?php if (! $c['isEmpty']) : ?> |
|
105 | + <?php if (!$c['isEmpty']) : ?> |
|
106 | 106 | <?php if ($c['hasTabContent']) : ?> |
107 | 107 | <div id="blitzphp-<?= $c['key'] ?>" class="tab"> |
108 | 108 | <h2><?= $c['title'] ?> <span><?= $c['titleDetails'] ?></span></h2> |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | </a> |
150 | 150 | |
151 | 151 | <?php if (isset($vars['session'])) : ?> |
152 | - <?php if (! empty($vars['session'])) : ?> |
|
152 | + <?php if (!empty($vars['session'])) : ?> |
|
153 | 153 | <table id="session_table"> |
154 | 154 | <tbody> |
155 | 155 | <?php foreach ($vars['session'] as $key => $value) : ?> |