@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public static function setConfig($key, $config = null): void |
72 | 72 | { |
73 | 73 | if ($config === null) { |
74 | - if (! is_array($key)) { |
|
74 | + if (!is_array($key)) { |
|
75 | 75 | throw new LogicException('If config is null, key must be an array.'); |
76 | 76 | } |
77 | 77 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public static function getConfigOrFail(string $key) |
132 | 132 | { |
133 | - if (! isset(static::$_config[$key])) { |
|
133 | + if (!isset(static::$_config[$key])) { |
|
134 | 134 | throw new InvalidArgumentException(sprintf('Expected configuration `%s` not found.', $key)); |
135 | 135 | } |
136 | 136 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public static function drop(string $config): bool |
154 | 154 | { |
155 | - if (! isset(static::$_config[$config])) { |
|
155 | + if (!isset(static::$_config[$config])) { |
|
156 | 156 | return false; |
157 | 157 | } |
158 | 158 | /** @psalm-suppress RedundantPropertyInitializationCheck */ |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | preg_match($pattern, $dsn, $parsed); |
252 | 252 | |
253 | - if (! $parsed) { |
|
253 | + if (!$parsed) { |
|
254 | 254 | throw new InvalidArgumentException("The DSN string '{$dsn}' could not be parsed."); |
255 | 255 | } |
256 | 256 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | } elseif (strpos($k, '_') === 0) { |
263 | 263 | $exists[substr($k, 1)] = ($v !== ''); |
264 | 264 | unset($parsed[$k]); |
265 | - } elseif ($v === '' && ! $exists[$k]) { |
|
265 | + } elseif ($v === '' && !$exists[$k]) { |
|
266 | 266 | unset($parsed[$k]); |
267 | 267 | } |
268 | 268 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function setConfig($key, $value = null, bool $merge = true): self |
69 | 69 | { |
70 | - if (! $this->_configInitialized) { |
|
70 | + if (!$this->_configInitialized) { |
|
71 | 71 | $this->_config = $this->_defaultConfig; |
72 | 72 | $this->_configInitialized = true; |
73 | 73 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function getConfig(?string $key = null, $default = null) |
114 | 114 | { |
115 | - if (! $this->_configInitialized) { |
|
115 | + if (!$this->_configInitialized) { |
|
116 | 116 | $this->_config = $this->_defaultConfig; |
117 | 117 | $this->_configInitialized = true; |
118 | 118 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public function configShallow($key, $value = null): self |
168 | 168 | { |
169 | - if (! $this->_configInitialized) { |
|
169 | + if (!$this->_configInitialized) { |
|
170 | 170 | $this->_config = $this->_defaultConfig; |
171 | 171 | $this->_configInitialized = true; |
172 | 172 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $return = $this->_config; |
193 | 193 | |
194 | 194 | foreach (explode('.', $key) as $k) { |
195 | - if (! is_array($return) || ! isset($return[$k])) { |
|
195 | + if (!is_array($return) || !isset($return[$k])) { |
|
196 | 196 | $return = null; |
197 | 197 | break; |
198 | 198 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $stack = explode('.', $key); |
251 | 251 | |
252 | 252 | foreach ($stack as $k) { |
253 | - if (! is_array($update)) { |
|
253 | + if (!is_array($update)) { |
|
254 | 254 | throw new Exception(sprintf('Cannot set %s value', $key)); |
255 | 255 | } |
256 | 256 | |
@@ -280,11 +280,11 @@ discard block |
||
280 | 280 | $length = count($stack); |
281 | 281 | |
282 | 282 | foreach ($stack as $i => $k) { |
283 | - if (! is_array($update)) { |
|
283 | + if (!is_array($update)) { |
|
284 | 284 | throw new Exception(sprintf('Cannot unset %s value', $key)); |
285 | 285 | } |
286 | 286 | |
287 | - if (! isset($update[$k])) { |
|
287 | + if (!isset($update[$k])) { |
|
288 | 288 | break; |
289 | 289 | } |
290 | 290 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public static function getInstance() |
37 | 37 | { |
38 | - if (! (static::$_instance instanceof static)) { |
|
38 | + if (!(static::$_instance instanceof static)) { |
|
39 | 39 | $params = func_get_args(); |
40 | 40 | static::$_instance = new static(...$params); |
41 | 41 | } |
@@ -60,98 +60,98 @@ discard block |
||
60 | 60 | */ |
61 | 61 | defined('LAYOUT_PATH') || define('LAYOUT_PATH', VIEW_PATH . 'layouts' . DS); |
62 | 62 | |
63 | -if (! defined('MIDDLEWARE_PATH')) { |
|
63 | +if (!defined('MIDDLEWARE_PATH')) { |
|
64 | 64 | /** |
65 | 65 | * Middlewares directory path |
66 | 66 | */ |
67 | 67 | define('MIDDLEWARE_PATH', APP_PATH . 'middlewares' . DS); |
68 | 68 | } |
69 | 69 | |
70 | -if (! defined('MODEL_PATH')) { |
|
70 | +if (!defined('MODEL_PATH')) { |
|
71 | 71 | /** |
72 | 72 | * Models directory path |
73 | 73 | */ |
74 | 74 | define('MODEL_PATH', APP_PATH . 'models' . DS); |
75 | 75 | } |
76 | 76 | |
77 | -if (! defined('RESOURCE_PATH')) { |
|
77 | +if (!defined('RESOURCE_PATH')) { |
|
78 | 78 | /** |
79 | 79 | * Resources directory path |
80 | 80 | */ |
81 | 81 | define('RESOURCE_PATH', APP_PATH . 'resources' . DS); |
82 | 82 | } |
83 | 83 | |
84 | -if (! defined('LANG_PATH')) { |
|
84 | +if (!defined('LANG_PATH')) { |
|
85 | 85 | /** |
86 | 86 | * File translation directory path |
87 | 87 | */ |
88 | 88 | define('LANG_PATH', RESOURCE_PATH . 'lang' . DS); |
89 | 89 | } |
90 | 90 | |
91 | -if (! defined('SERVICE_PATH')) { |
|
91 | +if (!defined('SERVICE_PATH')) { |
|
92 | 92 | /** |
93 | 93 | * Services directory path |
94 | 94 | */ |
95 | 95 | define('SERVICE_PATH', APP_PATH . 'services' . DS); |
96 | 96 | } |
97 | 97 | |
98 | -if (! defined('LOG_PATH')) { |
|
98 | +if (!defined('LOG_PATH')) { |
|
99 | 99 | /** |
100 | 100 | * Application logs files storage path |
101 | 101 | */ |
102 | 102 | define('LOG_PATH', STORAGE_PATH . 'logs' . DS); |
103 | 103 | } |
104 | 104 | |
105 | -if (! defined('DATABASE_PATH')) { |
|
105 | +if (!defined('DATABASE_PATH')) { |
|
106 | 106 | /** |
107 | 107 | * Database storage directory path |
108 | 108 | */ |
109 | 109 | define('DATABASE_PATH', STORAGE_PATH . 'database' . DS); |
110 | 110 | } |
111 | 111 | |
112 | -if (! defined('DB_MIGRATION_PATH')) { |
|
112 | +if (!defined('DB_MIGRATION_PATH')) { |
|
113 | 113 | /** |
114 | 114 | * Database migrations storage path |
115 | 115 | */ |
116 | 116 | define('DB_MIGRATION_PATH', RESOURCE_PATH . 'database' . DS . 'migrations' . DS); |
117 | 117 | } |
118 | 118 | |
119 | -if (! defined('DB_SEED_PATH')) { |
|
119 | +if (!defined('DB_SEED_PATH')) { |
|
120 | 120 | /** |
121 | 121 | * Database seeds storage path |
122 | 122 | */ |
123 | 123 | define('DB_SEED_PATH', RESOURCE_PATH . 'database' . DS . 'seeds' . DS); |
124 | 124 | } |
125 | 125 | |
126 | -if (! defined('DB_DUMP_PATH')) { |
|
126 | +if (!defined('DB_DUMP_PATH')) { |
|
127 | 127 | /** |
128 | 128 | * Database backup storage path |
129 | 129 | */ |
130 | 130 | define('DB_DUMP_PATH', DATABASE_PATH . 'dump' . DS); |
131 | 131 | } |
132 | 132 | |
133 | -if (! defined('DB_CACHE_PATH')) { |
|
133 | +if (!defined('DB_CACHE_PATH')) { |
|
134 | 134 | /** |
135 | 135 | * Database cache directory path |
136 | 136 | */ |
137 | 137 | define('DB_CACHE_PATH', DATABASE_PATH . 'cache' . DS); |
138 | 138 | } |
139 | 139 | |
140 | -if (! defined('SMARTY_CACHE_PATH')) { |
|
140 | +if (!defined('SMARTY_CACHE_PATH')) { |
|
141 | 141 | /** |
142 | 142 | * Smarty views cache directory path |
143 | 143 | */ |
144 | 144 | define('SMARTY_CACHE_PATH', STORAGE_PATH . 'smarty' . DS . 'cache' . DS); |
145 | 145 | } |
146 | 146 | |
147 | -if (! defined('SMARTY_COMPILES_PATH')) { |
|
147 | +if (!defined('SMARTY_COMPILES_PATH')) { |
|
148 | 148 | /** |
149 | 149 | * Smarty views compile directory path |
150 | 150 | */ |
151 | 151 | define('SMARTY_COMPILES_PATH', STORAGE_PATH . 'smarty' . DS . 'compiles' . DS); |
152 | 152 | } |
153 | 153 | |
154 | -if (! defined('SMARTY_CONF_PATH')) { |
|
154 | +if (!defined('SMARTY_CONF_PATH')) { |
|
155 | 155 | /** |
156 | 156 | * Smarty views config directory path |
157 | 157 | */ |
@@ -193,11 +193,11 @@ discard block |
||
193 | 193 | */ |
194 | 194 | defined('SECOND') || define('SECOND', 1); |
195 | 195 | defined('MINUTE') || define('MINUTE', 60); |
196 | -defined('HOUR') || define('HOUR', 3600); |
|
197 | -defined('DAY') || define('DAY', 86400); |
|
198 | -defined('WEEK') || define('WEEK', 604800); |
|
199 | -defined('MONTH') || define('MONTH', 2592000); |
|
200 | -defined('YEAR') || define('YEAR', 31536000); |
|
196 | +defined('HOUR') || define('HOUR', 3600); |
|
197 | +defined('DAY') || define('DAY', 86400); |
|
198 | +defined('WEEK') || define('WEEK', 604800); |
|
199 | +defined('MONTH') || define('MONTH', 2592000); |
|
200 | +defined('YEAR') || define('YEAR', 31536000); |
|
201 | 201 | defined('DECADE') || define('DECADE', 315360000); |
202 | 202 | |
203 | 203 | /* |
@@ -225,13 +225,13 @@ discard block |
||
225 | 225 | | http://tldp.org/LDP/abs/html/exitcodes.html |
226 | 226 | | |
227 | 227 | */ |
228 | -defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // no errors |
|
229 | -defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // generic error |
|
230 | -defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // configuration error |
|
231 | -defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // file not found |
|
232 | -defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // unknown class |
|
228 | +defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // no errors |
|
229 | +defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // generic error |
|
230 | +defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // configuration error |
|
231 | +defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // file not found |
|
232 | +defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // unknown class |
|
233 | 233 | defined('EXIT_UNKNOWN_METHOD') || define('EXIT_UNKNOWN_METHOD', 6); // unknown class member |
234 | -defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // invalid user input |
|
235 | -defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error |
|
236 | -defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code |
|
237 | -defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code |
|
234 | +defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // invalid user input |
|
235 | +defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error |
|
236 | +defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code |
|
237 | +defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code |
@@ -53,19 +53,19 @@ |
||
53 | 53 | */ |
54 | 54 | public static function type(string $mime): FormatterInterface |
55 | 55 | { |
56 | - if (! array_key_exists($mime, self::$formatters)) { |
|
56 | + if (!array_key_exists($mime, self::$formatters)) { |
|
57 | 57 | throw FormatException::invalidMime($mime); |
58 | 58 | } |
59 | 59 | |
60 | 60 | $className = self::$formatters[$mime]; |
61 | 61 | |
62 | - if (! class_exists($className)) { |
|
62 | + if (!class_exists($className)) { |
|
63 | 63 | throw FormatException::invalidFormatter($className); |
64 | 64 | } |
65 | 65 | |
66 | 66 | $class = new $className(); |
67 | 67 | |
68 | - if (! $class instanceof FormatterInterface) { |
|
68 | + if (!$class instanceof FormatterInterface) { |
|
69 | 69 | throw FormatException::invalidFormatter($className); |
70 | 70 | } |
71 | 71 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | // Forcez-le à être quelque chose d'utile |
46 | - if (! is_array($data) && ! is_object($data)) { |
|
46 | + if (!is_array($data) && !is_object($data)) { |
|
47 | 47 | $data = (array) $data; |
48 | 48 | } |
49 | 49 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | return null; |
48 | 48 | } |
49 | 49 | |
50 | - if (! is_array($data)) { |
|
50 | + if (!is_array($data)) { |
|
51 | 51 | $data = (array) $data; |
52 | 52 | } |
53 | 53 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | foreach ($data as $record) { |
66 | 66 | // Si l'enregistrement n'est pas un tableau, alors break. |
67 | 67 | // C'est parce que le 2ème paramètre de fputcsv() doit être un tableau |
68 | - if (! is_array($record)) { |
|
68 | + if (!is_array($record)) { |
|
69 | 69 | break; |
70 | 70 | } |
71 | 71 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $callback = Services::request()->getQuery('callback'); |
33 | 33 | |
34 | 34 | if (empty($callback)) { |
35 | - return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); |
|
35 | + return json_encode($data, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | // Nous n'honorons qu'un rappel jsonp qui sont des identifiants javascript valides |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function format($data) |
27 | 27 | { |
28 | - if (! is_array($data)) { |
|
28 | + if (!is_array($data)) { |
|
29 | 29 | $data = (array) $data; |
30 | 30 | } |
31 | 31 |