@@ -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 |
@@ -69,7 +69,7 @@ |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - if ($plugin || ! static::_classExistsInBase($fullname, 'BlitzPHP')) { |
|
72 | + if ($plugin || !static::_classExistsInBase($fullname, 'BlitzPHP')) { |
|
73 | 73 | return null; |
74 | 74 | } |
75 | 75 |
@@ -122,7 +122,7 @@ |
||
122 | 122 | ->requireDirectory(APP_PATH, Checker::CHECK_IS_READABLE); |
123 | 123 | |
124 | 124 | $output = $checker->check(); |
125 | - if (! $checker->isSatisfied()) { |
|
125 | + if (!$checker->isSatisfied()) { |
|
126 | 126 | echo '<h3>An error encourred</h3>'; |
127 | 127 | |
128 | 128 | exit(implode('<br/> ', $checker->getErrors())); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | describe("Router", function() { |
10 | 10 | beforeEach(function() { |
11 | - $this->collection = new RouteCollection(); |
|
11 | + $this->collection = new RouteCollection(); |
|
12 | 12 | |
13 | 13 | $routes = [ |
14 | 14 | 'users' => 'Users::index', |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | |
377 | 377 | expect(function() use ($router) { |
378 | 378 | $router->handle('admin/admins/edit/1'); |
379 | - })->toThrow(new RouterException( 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: \App/Admin/Admins::edit_show/$1')); |
|
379 | + })->toThrow(new RouterException('The namespace delimiter is a backslash (\), not a slash (/). Route handler: \App/Admin/Admins::edit_show/$1')); |
|
380 | 380 | }); |
381 | 381 | |
382 | 382 | it(': Route avec barre oblique en tête', function() { |
@@ -398,11 +398,11 @@ discard block |
||
398 | 398 | }); |
399 | 399 | |
400 | 400 | it(': Options de route', function() { |
401 | - $this->collection->add('foo', static function () {}, [ |
|
401 | + $this->collection->add('foo', static function() {}, [ |
|
402 | 402 | 'as' => 'login', |
403 | 403 | 'foo' => 'baz', |
404 | 404 | ]); |
405 | - $this->collection->add('baz', static function () {}, [ |
|
405 | + $this->collection->add('baz', static function() {}, [ |
|
406 | 406 | 'as' => 'admin', |
407 | 407 | 'foo' => 'bar', |
408 | 408 | ]); |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | |
471 | 471 | describe('Groupes et middlewares', function() { |
472 | 472 | it(': Le routeur fonctionne avec les middlewares', function() { |
473 | - $this->collection->group('foo', ['filter' => 'test'], static function (RouteCollection $routes) { |
|
473 | + $this->collection->group('foo', ['filter' => 'test'], static function(RouteCollection $routes) { |
|
474 | 474 | $routes->add('bar', 'TestController::foobar'); |
475 | 475 | }); |
476 | 476 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $_SERVER['ENVIRONMENT'] = 'testing'; |
24 | 24 | define('ENVIRONMENT', 'testing'); |
25 | 25 | defined('DEBUG') || define('DEBUG', true); |
26 | -defined('DS') || define('DS', DIRECTORY_SEPARATOR); |
|
26 | +defined('DS') || define('DS', DIRECTORY_SEPARATOR); |
|
27 | 27 | |
28 | 28 | // Often these constants are pre-defined, but query the current directory structure as a fallback |
29 | 29 | defined('HOME_PATH') || define('HOME_PATH', realpath(rtrim(getcwd(), '\\/ ')) . DS); |
@@ -35,15 +35,15 @@ discard block |
||
35 | 35 | defined('VENDOR_PATH') || define('VENDOR_PATH', realpath(HOME_PATH . 'vendor') . DS); |
36 | 36 | |
37 | 37 | // Define necessary framework path constants |
38 | -defined('SYST_PATH') || define('SYST_PATH', realpath(HOME_PATH . 'src') . DS); |
|
39 | -defined('TEST_PATH') || define('TEST_PATH', realpath(HOME_PATH . 'spec') . DS); |
|
38 | +defined('SYST_PATH') || define('SYST_PATH', realpath(HOME_PATH . 'src') . DS); |
|
39 | +defined('TEST_PATH') || define('TEST_PATH', realpath(HOME_PATH . 'spec') . DS); |
|
40 | 40 | defined('SUPPORT_PATH') || define('SUPPORT_PATH', TEST_PATH . '_support' . DS); |
41 | -defined('APP_PATH') || define('APP_PATH', SUPPORT_PATH . 'app' . DS); |
|
41 | +defined('APP_PATH') || define('APP_PATH', SUPPORT_PATH . 'app' . DS); |
|
42 | 42 | defined('STORAGE_PATH') || define('STORAGE_PATH', SUPPORT_PATH . 'storage' . DS); |
43 | -defined('WEBROOT') || define('WEBROOT', SUPPORT_PATH . 'public' . DS); |
|
43 | +defined('WEBROOT') || define('WEBROOT', SUPPORT_PATH . 'public' . DS); |
|
44 | 44 | |
45 | 45 | // Set environment values that would otherwise stop the framework from functioning during tests. |
46 | -if (! isset($_SERVER['app.baseURL'])) { |
|
46 | +if (!isset($_SERVER['app.baseURL'])) { |
|
47 | 47 | $_SERVER['app.baseURL'] = 'http://example.com/'; |
48 | 48 | } |
49 | 49 | define('BASE_URL', $_SERVER['app.baseURL']); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | if (file_exists(APP_PATH . 'Config' . DS . 'routes.php')) { |
73 | 73 | require_once APP_PATH . 'Config' . DS . 'routes.php'; |
74 | 74 | } |
75 | -if (empty($routes) || ! ($routes instanceof RouteCollectionInterface)) { |
|
75 | +if (empty($routes) || !($routes instanceof RouteCollectionInterface)) { |
|
76 | 76 | $routes = new RouteCollection(); |
77 | 77 | } |
78 | 78 |
@@ -239,16 +239,16 @@ |
||
239 | 239 | |
240 | 240 | |
241 | 241 | /** |
242 | - * Returns platform-specific SQL to disable foreign key checks. |
|
243 | - */ |
|
244 | - protected function _disableForeignKeyChecks(): string |
|
242 | + * Returns platform-specific SQL to disable foreign key checks. |
|
243 | + */ |
|
244 | + protected function _disableForeignKeyChecks(): string |
|
245 | 245 | { |
246 | 246 | return ''; |
247 | 247 | } |
248 | 248 | |
249 | 249 | /** |
250 | - * Returns platform-specific SQL to disable foreign key checks. |
|
251 | - */ |
|
250 | + * Returns platform-specific SQL to disable foreign key checks. |
|
251 | + */ |
|
252 | 252 | protected function _enableForeignKeyChecks(): string |
253 | 253 | { |
254 | 254 | return ''; |
@@ -49,7 +49,7 @@ |
||
49 | 49 | |
50 | 50 | $query->setQuery($sql, $binds, $setEscapeFlags); |
51 | 51 | |
52 | - if (! empty($this->swapPre) && ! empty($this->DBPrefix)) { |
|
52 | + if (!empty($this->swapPre) && !empty($this->DBPrefix)) { |
|
53 | 53 | $query->swapPrefix($this->DBPrefix, $this->swapPre); |
54 | 54 | } |
55 | 55 |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | { |
88 | 88 | if (is_array($config)) { |
89 | 89 | foreach ($config as $key => $value) { |
90 | - if (! is_string($value) || empty($value)) { |
|
90 | + if (!is_string($value) || empty($value)) { |
|
91 | 91 | continue; |
92 | 92 | } |
93 | 93 | if (is_string($key)) { |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | } |
100 | 100 | self::load($conf, $file); |
101 | 101 | } |
102 | - } elseif (is_string($config) && ! isset(self::$loaded[$config])) { |
|
102 | + } elseif (is_string($config) && !isset(self::$loaded[$config])) { |
|
103 | 103 | if (empty($file)) { |
104 | 104 | $file = self::path($config); |
105 | 105 | } |
106 | 106 | |
107 | 107 | $configurations = []; |
108 | - if (file_exists($file) && ! in_array($file, get_included_files(), true)) { |
|
108 | + if (file_exists($file) && !in_array($file, get_included_files(), true)) { |
|
109 | 109 | $configurations = (array) require $file; |
110 | 110 | } |
111 | 111 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | { |
131 | 131 | if (is_array($accepts_values)) { |
132 | 132 | $accepts_values = '(Accept values: ' . implode('/', $accepts_values) . ')'; |
133 | - } elseif (! is_string($accepts_values)) { |
|
133 | + } elseif (!is_string($accepts_values)) { |
|
134 | 134 | throw new InvalidArgumentException('Misuse of the method ' . __METHOD__); |
135 | 135 | } |
136 | 136 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $schema = require $app_schema; |
177 | 177 | } |
178 | 178 | |
179 | - if (empty($schema) || ! ($schema instanceof Schema)) { |
|
179 | + if (empty($schema) || !($schema instanceof Schema)) { |
|
180 | 180 | $schema = Expect::mixed(); |
181 | 181 | } |
182 | 182 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | private function initializeURL() |
203 | 203 | { |
204 | - if (! $this->configurator->exists('app.base_url')) { |
|
204 | + if (!$this->configurator->exists('app.base_url')) { |
|
205 | 205 | $config = 'auto'; |
206 | 206 | } else { |
207 | 207 | $config = $this->configurator->get('app.base_url'); |
@@ -257,17 +257,17 @@ discard block |
||
257 | 257 | */ |
258 | 258 | private function initializeDebugbar() |
259 | 259 | { |
260 | - if (! $this->configurator->exists('app.show_debugbar')) { |
|
260 | + if (!$this->configurator->exists('app.show_debugbar')) { |
|
261 | 261 | $config = 'auto'; |
262 | 262 | } else { |
263 | 263 | $config = $this->configurator->get('app.show_debugbar'); |
264 | 264 | } |
265 | 265 | |
266 | - if (! in_array($config, ['auto', true, false], true)) { |
|
266 | + if (!in_array($config, ['auto', true, false], true)) { |
|
267 | 267 | self::exceptBadConfigValue('show_debugbar', ['auto', true, false], 'app'); |
268 | 268 | } |
269 | 269 | if ($config === 'auto') { |
270 | - $this->configurator->set('app.show_debugbar', ! is_online()); |
|
270 | + $this->configurator->set('app.show_debugbar', !is_online()); |
|
271 | 271 | } |
272 | 272 | } |
273 | 273 | } |
@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | |
36 | 36 | // services système |
37 | 37 | $filename = SYST_PATH . 'Constants' . DS . 'providers.php'; |
38 | - if (! file_exists($filename)) { |
|
38 | + if (!file_exists($filename)) { |
|
39 | 39 | throw LoadException::providersDefinitionDontExist($filename); |
40 | 40 | } |
41 | - if (! in_array($filename, get_included_files(), true)) { |
|
41 | + if (!in_array($filename, get_included_files(), true)) { |
|
42 | 42 | $providers = array_merge($providers, require $filename); |
43 | 43 | } |
44 | 44 | |
45 | 45 | // services de l'application |
46 | 46 | $filename = CONFIG_PATH . 'providers.php'; |
47 | - if (file_exists($filename) && ! in_array($filename, get_included_files(), true)) { |
|
47 | + if (file_exists($filename) && !in_array($filename, get_included_files(), true)) { |
|
48 | 48 | $providers = array_merge($providers, require $filename); |
49 | 49 | } |
50 | 50 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | $locale ??= config('app.language'); |
79 | 79 | |
80 | - if (! self::isLoaded('langs', $file . $locale)) { |
|
80 | + if (!self::isLoaded('langs', $file . $locale)) { |
|
81 | 81 | self::loaded('langs', $file . $locale, FileLocator::lang($file, $locale)); |
82 | 82 | } |
83 | 83 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | private static function isLoaded(string $module, $element): bool |
93 | 93 | { |
94 | - if (! isset(self::$loads[$module]) || ! is_array(self::$loads[$module])) { |
|
94 | + if (!isset(self::$loads[$module]) || !is_array(self::$loads[$module])) { |
|
95 | 95 | return false; |
96 | 96 | } |
97 | 97 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | foreach ($paths as $path) { |
44 | 44 | if (file_exists($path)) { |
45 | - if (! in_array($path, get_included_files(), true)) { |
|
45 | + if (!in_array($path, get_included_files(), true)) { |
|
46 | 46 | $languages = array_merge($languages, (array) require($path)); |
47 | 47 | } |
48 | 48 | $file_exist = true; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | throw LoadException::libraryNotFound($lib); |
120 | 120 | } |
121 | 121 | |
122 | - if (true !== $file_syst && ! class_exists($lib)) { |
|
122 | + if (true !== $file_syst && !class_exists($lib)) { |
|
123 | 123 | throw LoadException::libraryDontExist($lib); |
124 | 124 | } |
125 | 125 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $model = explode('/', $model); |
138 | 138 | |
139 | 139 | $mod = ucfirst(end($model)); |
140 | - $mod = (! preg_match('#Model$#', $mod)) ? $mod . 'Model' : $mod; |
|
140 | + $mod = (!preg_match('#Model$#', $mod)) ? $mod . 'Model' : $mod; |
|
141 | 141 | $model[count($model) - 1] = $mod; |
142 | 142 | |
143 | 143 | foreach ($model as $key => &$value) { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | $path = MODEL_PATH . Helpers::ensureExt(implode(DS, $model), 'php'); |
150 | 150 | |
151 | - if (! file_exists($path)) { |
|
151 | + if (!file_exists($path)) { |
|
152 | 152 | throw LoadException::modelNotFound($mod, $path); |
153 | 153 | } |
154 | 154 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | if (class_exists($class_namespaced, false)) { |
160 | 160 | return Injector::make($class_namespaced); |
161 | 161 | } |
162 | - if (! class_exists($mod, false)) { |
|
162 | + if (!class_exists($mod, false)) { |
|
163 | 163 | throw LoadException::modelDontExist($mod, $path); |
164 | 164 | } |
165 | 165 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $controller = explode('/', $controller); |
178 | 178 | |
179 | 179 | $con = ucfirst(end($controller)); |
180 | - $con = (! preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con; |
|
180 | + $con = (!preg_match('#Controller$#', $con)) ? $con . 'Controller' : $con; |
|
181 | 181 | $controller[count($controller) - 1] = $con; |
182 | 182 | |
183 | 183 | foreach ($controller as $key => &$value) { |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | $path = CONTROLLER_PATH . Helpers::ensureExt(implode(DS, $controller), 'php'); |
190 | 190 | |
191 | - if (! file_exists($path)) { |
|
191 | + if (!file_exists($path)) { |
|
192 | 192 | throw LoadException::controllerNotFound(str_replace('Controller', '', $con), $path); |
193 | 193 | } |
194 | 194 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | if (class_exists($class_namespaced, false)) { |
200 | 200 | return Injector::make($class_namespaced); |
201 | 201 | } |
202 | - if (! class_exists($con, false)) { |
|
202 | + if (!class_exists($con, false)) { |
|
203 | 203 | throw LoadException::controllerDontExist(str_replace('Controller', '', $con), $path); |
204 | 204 | } |
205 | 205 |