@@ -28,7 +28,7 @@ |
||
28 | 28 | 'AllowMethods' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'], |
29 | 29 | 'AllowHeaders' => true, |
30 | 30 | 'ExposeHeaders' => false, |
31 | - 'MaxAge' => 86400, // 1 day |
|
31 | + 'MaxAge' => 86400, // 1 day |
|
32 | 32 | ]; |
33 | 33 | |
34 | 34 | /** |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | Kint::$display_called_from = $config->display_called_from; |
20 | 20 | Kint::$expanded = $config->expanded; |
21 | 21 | |
22 | -if (! empty($config->plugins)) { |
|
22 | +if (!empty($config->plugins)) { |
|
23 | 23 | Kint::$plugins = $config->plugins; |
24 | 24 | } |
25 | 25 | |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | RichRenderer::$folder = $config->rich_folder; |
28 | 28 | RichRenderer::$sort = $config->rich_sort; |
29 | 29 | |
30 | -if (! empty($config->rich_value_plugins)) { |
|
30 | +if (!empty($config->rich_value_plugins)) { |
|
31 | 31 | RichRenderer::$value_plugins = $config->rich_value_plugins; |
32 | 32 | } |
33 | -if (! empty($config->rich_tab_plugins)) { |
|
33 | +if (!empty($config->rich_tab_plugins)) { |
|
34 | 34 | RichRenderer::$tab_plugins = $config->rich_tab_plugins; |
35 | 35 | } |
36 | 36 |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @credit <a href="https://codeigniter.com">CodeIgniter 4.2 - date_helper</a> |
18 | 18 | */ |
19 | -if (! function_exists('now')) { |
|
19 | +if (!function_exists('now')) { |
|
20 | 20 | /** |
21 | 21 | * Get "now" time |
22 | 22 | * |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | -if (! function_exists('timezone_select')) { |
|
56 | +if (!function_exists('timezone_select')) { |
|
57 | 57 | /** |
58 | 58 | * Generates a select field of all available timezones |
59 | 59 | * |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @credit <a href="https://codeigniter.com">CodeIgniter 4.2 - number_helper</a> |
16 | 16 | */ |
17 | -if (! function_exists('number_to_size')) { |
|
17 | +if (!function_exists('number_to_size')) { |
|
18 | 18 | /** |
19 | 19 | * Formats a numbers as bytes, based on size, and adds the appropriate suffix |
20 | 20 | * |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | // ignore sub part |
36 | 36 | $generalLocale = $locale; |
37 | - if (! empty($locale) && ($underscorePos = strpos($locale, '_'))) { |
|
37 | + if (!empty($locale) && ($underscorePos = strpos($locale, '_'))) { |
|
38 | 38 | $generalLocale = substr($locale, 0, $underscorePos); |
39 | 39 | } |
40 | 40 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | -if (! function_exists('number_to_amount')) { |
|
61 | +if (!function_exists('number_to_amount')) { |
|
62 | 62 | /** |
63 | 63 | * Converts numbers to a more readable representation |
64 | 64 | * when dealing with very large numbers (in the thousands or above), |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | // ignore sub part |
89 | 89 | $generalLocale = $locale; |
90 | - if (! empty($locale) && ($underscorePos = strpos($locale, '_'))) { |
|
90 | + if (!empty($locale) && ($underscorePos = strpos($locale, '_'))) { |
|
91 | 91 | $generalLocale = substr($locale, 0, $underscorePos); |
92 | 92 | } |
93 | 93 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
115 | -if (! function_exists('number_to_currency')) { |
|
115 | +if (!function_exists('number_to_currency')) { |
|
116 | 116 | function number_to_currency(float $num, string $currency, ?string $locale = null, int $fraction = 0): string |
117 | 117 | { |
118 | 118 | return format_number($num, 1, $locale, [ |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
126 | -if (! function_exists('format_number')) { |
|
126 | +if (!function_exists('format_number')) { |
|
127 | 127 | /** |
128 | 128 | * A general purpose, locale-aware, number_format method. |
129 | 129 | * Used by all of the functions of the number_helper. |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
175 | -if (! function_exists('number_to_roman')) { |
|
175 | +if (!function_exists('number_to_roman')) { |
|
176 | 176 | /** |
177 | 177 | * Convert a number to a roman numeral. |
178 | 178 | * |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $config = config('cache'); |
55 | 55 | $handler = $this->argument('driver', $config['handler']); |
56 | 56 | |
57 | - if (! array_key_exists($handler, $config['valid_handlers'])) { |
|
57 | + if (!array_key_exists($handler, $config['valid_handlers'])) { |
|
58 | 58 | $this->fail($handler . 'n\'est pas un gestionnaire de cache valide.'); |
59 | 59 | |
60 | 60 | return; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $config['handler'] = $handler; |
64 | 64 | $cache = Services::cache($config); |
65 | 65 | |
66 | - if (! $cache->clear()) { |
|
66 | + if (!$cache->clear()) { |
|
67 | 67 | // @codeCoverageIgnoreStart |
68 | 68 | $this->fail('Erreur lors de l\'effacement du cache.'); |
69 | 69 |
@@ -69,7 +69,7 @@ |
||
69 | 69 | 'nom' => $key, |
70 | 70 | 'chemin du serveur' => clean_path($field['server_path']), |
71 | 71 | 'taille' => number_to_size($field['size']), |
72 | - 'date' => $field['date'], // @todo formatter avec Utilities\Date |
|
72 | + 'date' => $field['date'], // @todo formatter avec Utilities\Date |
|
73 | 73 | ]; |
74 | 74 | } |
75 | 75 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | namespace {namespace}; |
4 | 4 | |
5 | 5 | use BlitzPHP\Database\Migration\Migration; |
6 | -<?php if (! empty($table) && ! empty($action)): ?> |
|
6 | +<?php if (!empty($table) && !empty($action)): ?> |
|
7 | 7 | use BlitzPHP\Database\Migration\Structure; |
8 | 8 | <?php endif; ?> |
9 | 9 |
@@ -17,7 +17,8 @@ discard block |
||
17 | 17 | { |
18 | 18 | <?php if (empty($table) || empty($action)): ?> |
19 | 19 | // |
20 | -<?php else: ?> |
|
20 | +<?php else { |
|
21 | + : ?> |
|
21 | 22 | $this-><?= $action ?>('<?= $table ?>', function(Structure $table) { |
22 | 23 | <?php if ($session): ?> |
23 | 24 | $table->string('id', 128); |
@@ -28,12 +29,17 @@ discard block |
||
28 | 29 | $table->primary(['id', 'ip_address']); |
29 | 30 | <?php else: ?> |
30 | 31 | $table->primary('id'); |
31 | -<?php endif; ?> |
|
32 | +<?php endif; |
|
33 | +} |
|
34 | +?> |
|
32 | 35 | $table->index('timestamp'); |
33 | -<?php else: ?> |
|
36 | +<?php else { |
|
37 | + : ?> |
|
34 | 38 | $table->id(); |
35 | 39 | $table->timestamps(); |
36 | -<?php endif; ?> |
|
40 | +<?php endif; |
|
41 | +} |
|
42 | +?> |
|
37 | 43 | |
38 | 44 | return $table; |
39 | 45 | }); |
@@ -46,10 +52,13 @@ discard block |
||
46 | 52 | // |
47 | 53 | <?php elseif ($action === 'create') : ?> |
48 | 54 | $this->dropIfExists('<?= $table ?>'); |
49 | -<?php else: ?> |
|
55 | +<?php else { |
|
56 | + : ?> |
|
50 | 57 | $this->modify('<?= $table ?>', function(Structure $table) { |
51 | 58 | // |
52 | 59 | }); |
53 | -<?php endif; ?> |
|
60 | +<?php endif; |
|
61 | +} |
|
62 | +?> |
|
54 | 63 | } |
55 | 64 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | throw new InvalidArgumentException('Impossible d\'utiliser "create" et "modify" au même moment pour la génération des migrations.'); |
99 | 99 | } |
100 | 100 | |
101 | - if (! $create && ! $modify) { |
|
101 | + if (!$create && !$modify) { |
|
102 | 102 | $data['action'] = null; |
103 | 103 | } else { |
104 | 104 | $data['action'] = $create ? 'create' : 'modify'; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | - if (! is_string($table) || $table === '') { |
|
120 | + if (!is_string($table) || $table === '') { |
|
121 | 121 | if ($data['session']) { |
122 | 122 | $table = 'blitz_sessions'; |
123 | 123 | } elseif (is_string($create)) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $this->renderVars['file'] = $this->getRenderedFile($options, $this->renderVars['view'], 'tpl'); |
62 | 62 | |
63 | 63 | $layout = $this->layout; |
64 | - if (! empty($layout)) { |
|
64 | + if (!empty($layout)) { |
|
65 | 65 | if (empty(pathinfo($layout, PATHINFO_EXTENSION))) { |
66 | 66 | $layout .= '.tpl'; |
67 | 67 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->engine->assign($this->data); |
72 | 72 | |
73 | 73 | // Doit-on mettre en cache? |
74 | - if (! empty($this->renderVars['options']['cache_name']) || ! empty($this->renderVars['options']['cache'])) { |
|
74 | + if (!empty($this->renderVars['options']['cache_name']) || !empty($this->renderVars['options']['cache'])) { |
|
75 | 75 | $this->enableCache(); |
76 | 76 | $this->engine->setCacheLifetime(60 * $this->renderVars['options']['cache'] ?? 60); |
77 | 77 | $this->engine->setCompileId($this->renderVars['options']['cache_name'] ?? null); |