@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | chdir(WEBROOT); |
22 | 22 | } |
23 | 23 | |
24 | -return function (array $paths, string $paths_config_file, bool $is_cli) { |
|
24 | +return function(array $paths, string $paths_config_file, bool $is_cli) { |
|
25 | 25 | // Le chemin d'accès vers le dossier de l'application |
26 | 26 | if (is_dir($paths['app'])) { |
27 | 27 | if (($_temp = realpath($paths['app'])) !== false) { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | require_once __DIR__ . DS . 'kint.php'; |
103 | 103 | |
104 | - if (! $is_cli) { |
|
104 | + if (!$is_cli) { |
|
105 | 105 | $app->run(); |
106 | 106 | } |
107 | 107 | }; |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | $_SERVER['ENVIRONMENT'] = 'testing'; |
20 | 20 | define('ENVIRONMENT', 'testing'); |
21 | 21 | defined('DEBUG') || define('DEBUG', true); |
22 | -defined('DS') || define('DS', DIRECTORY_SEPARATOR); |
|
22 | +defined('DS') || define('DS', DIRECTORY_SEPARATOR); |
|
23 | 23 | |
24 | 24 | // Souvent, ces constantes sont prédéfinis, mais interroger la structure actuelle du répertoire comme un repli |
25 | 25 | defined('HOME_PATH') || define('HOME_PATH', realpath(rtrim(getcwd(), '\\/ ')) . DS); |
26 | 26 | defined('VENDOR_PATH') || define('VENDOR_PATH', realpath(HOME_PATH . 'vendor') . DS); |
27 | 27 | defined('COMPOSER_PATH') || define('COMPOSER_PATH', realpath(VENDOR_PATH . 'autoload.php')); |
28 | -if (! is_file(COMPOSER_PATH)) { |
|
28 | +if (!is_file(COMPOSER_PATH)) { |
|
29 | 29 | echo 'Votre fichier autoload de Composer ne semble pas être défini correctement. '; |
30 | 30 | echo 'Veuillez ouvrir le fichier suivant et pour corriger: "' . __FILE__ . '"'; |
31 | 31 | exit(3); // EXIT_CONFIG |
@@ -33,15 +33,15 @@ discard block |
||
33 | 33 | require_once COMPOSER_PATH; |
34 | 34 | |
35 | 35 | // Définir les constantes nécessaires au framework |
36 | -defined('SYST_PATH') || define('SYST_PATH', realpath(HOME_PATH . 'src') . DS); |
|
37 | -defined('TEST_PATH') || define('TEST_PATH', realpath(HOME_PATH . 'spec') . DS); |
|
36 | +defined('SYST_PATH') || define('SYST_PATH', realpath(HOME_PATH . 'src') . DS); |
|
37 | +defined('TEST_PATH') || define('TEST_PATH', realpath(HOME_PATH . 'spec') . DS); |
|
38 | 38 | defined('SUPPORT_PATH') || define('SUPPORT_PATH', TEST_PATH . 'application' . DS); |
39 | -defined('APP_PATH') || define('APP_PATH', SUPPORT_PATH . 'app' . DS); |
|
39 | +defined('APP_PATH') || define('APP_PATH', SUPPORT_PATH . 'app' . DS); |
|
40 | 40 | defined('STORAGE_PATH') || define('STORAGE_PATH', SUPPORT_PATH . 'storage' . DS); |
41 | -defined('WEBROOT') || define('WEBROOT', SUPPORT_PATH . 'public' . DS); |
|
41 | +defined('WEBROOT') || define('WEBROOT', SUPPORT_PATH . 'public' . DS); |
|
42 | 42 | |
43 | 43 | // Définissez des valeurs d'environnement qui empêcheraient autrement le cadre de fonctionner pendant les tests. |
44 | -if (! isset($_SERVER['app.baseURL'])) { |
|
44 | +if (!isset($_SERVER['app.baseURL'])) { |
|
45 | 45 | $_SERVER['app.baseURL'] = 'http://example.com/'; |
46 | 46 | } |
47 | 47 | define('BASE_URL', $_SERVER['app.baseURL']); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | /** |
50 | 50 | * Chargement du fichier responsable du demarrage du systeme |
51 | 51 | */ |
52 | -$bootstrap = require_once SYST_PATH . 'Initializer' . DS. 'bootstrap.php'; |
|
52 | +$bootstrap = require_once SYST_PATH . 'Initializer' . DS . 'bootstrap.php'; |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * Lancement de l'application |
@@ -11,11 +11,11 @@ discard block |
||
11 | 11 | |
12 | 12 | use BlitzPHP\Utilities\Date; |
13 | 13 | |
14 | -describe('Utilities / Date', function () { |
|
15 | - describe('Helper date', function () { |
|
14 | +describe('Utilities / Date', function() { |
|
15 | + describe('Helper date', function() { |
|
16 | 16 | helper('date'); |
17 | 17 | |
18 | - it('Now() par défaut', function () { |
|
18 | + it('Now() par défaut', function() { |
|
19 | 19 | Date::setTestNow('April 09, 2023'); |
20 | 20 | |
21 | 21 | expect(now(null, false))->toBe(1_680_994_800); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | Date::setTestNow(); |
24 | 24 | }); |
25 | 25 | |
26 | - it('Now() specifique', function () { |
|
26 | + it('Now() specifique', function() { |
|
27 | 27 | Date::setTestNow('April 09, 2023', 'America/Chicago'); |
28 | 28 | |
29 | 29 | // Chicago should be two hours ahead of Vancouver |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | Date::setTestNow(); |
33 | 33 | }); |
34 | 34 | |
35 | - it('Liste deroulante de timezone avec timezone par defaut', function () { |
|
35 | + it('Liste deroulante de timezone avec timezone par defaut', function() { |
|
36 | 36 | $timezones = DateTimeZone::listIdentifiers(); |
37 | 37 | |
38 | 38 | $expected = "<select name='timezone' class='custom-select'>\n"; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | expect($expected)->toBe(timezone_select('custom-select', 'Africa/Douala')); |
48 | 48 | }); |
49 | 49 | |
50 | - it('Liste deroulante de timezone avec regions geographique specifiee', function () { |
|
50 | + it('Liste deroulante de timezone avec regions geographique specifiee', function() { |
|
51 | 51 | $spesificRegion = DateTimeZone::AFRICA; |
52 | 52 | $timezones = DateTimeZone::listIdentifiers($spesificRegion, null); |
53 | 53 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | expect($expected)->toBe(timezone_select('custom-select', 'Africa/Douala', $spesificRegion)); |
64 | 64 | }); |
65 | 65 | |
66 | - it('Liste deroulante de timezone par pays specifie', function () { |
|
66 | + it('Liste deroulante de timezone par pays specifie', function() { |
|
67 | 67 | $spesificRegion = DateTimeZone::PER_COUNTRY; |
68 | 68 | $country = 'CM'; |
69 | 69 | $timezones = DateTimeZone::listIdentifiers($spesificRegion, $country); |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | }); |
82 | 82 | }); |
83 | 83 | |
84 | - describe('Date', function () { |
|
85 | - it('Date', function () { |
|
84 | + describe('Date', function() { |
|
85 | + it('Date', function() { |
|
86 | 86 | $formatter = new IntlDateFormatter( |
87 | 87 | 'en_US', |
88 | 88 | IntlDateFormatter::SHORT, |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | expect($formatter->format($date))->toBe($date->toDateTimeString()); |
98 | 98 | }); |
99 | 99 | |
100 | - it('Date avec timezone', function () { |
|
100 | + it('Date avec timezone', function() { |
|
101 | 101 | $formatter = new IntlDateFormatter( |
102 | 102 | 'en_US', |
103 | 103 | IntlDateFormatter::SHORT, |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | expect($formatter->format($date))->toBe($date->toDateTimeString()); |
113 | 113 | }); |
114 | 114 | |
115 | - it('Date avec timezone et langue', function () { |
|
115 | + it('Date avec timezone et langue', function() { |
|
116 | 116 | $formatter = new IntlDateFormatter( |
117 | 117 | 'fr_FR', |
118 | 118 | IntlDateFormatter::SHORT, |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | expect($formatter->format($date))->toBe($date->toDateTimeString()); |
128 | 128 | }); |
129 | 129 | |
130 | - it('Date avec datetimezone', function () { |
|
130 | + it('Date avec datetimezone', function() { |
|
131 | 131 | $formatter = new IntlDateFormatter( |
132 | 132 | 'fr_FR', |
133 | 133 | IntlDateFormatter::SHORT, |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | expect($formatter->format($date))->toBe($date->toDateTimeString()); |
143 | 143 | }); |
144 | 144 | |
145 | - it('toDateTime', function () { |
|
145 | + it('toDateTime', function() { |
|
146 | 146 | $date = new Date(); |
147 | 147 | |
148 | 148 | $obj = $date->toDateTime(); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | expect($obj)->toBeAnInstanceOf(DateTime::class); |
151 | 151 | }); |
152 | 152 | |
153 | - it('now', function () { |
|
153 | + it('now', function() { |
|
154 | 154 | $date = Date::now(); |
155 | 155 | $date1 = new DateTime(); |
156 | 156 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | expect($date->getTimestamp())->toBe($date1->getTimestamp()); |
159 | 159 | }); |
160 | 160 | |
161 | - it('parse', function () { |
|
161 | + it('parse', function() { |
|
162 | 162 | $date = Date::parse('next Tuesday', 'America/Chicago'); |
163 | 163 | $date1 = new DateTime('now', new DateTimeZone('America/Chicago')); |
164 | 164 | $date1->modify('next Tuesday'); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | expect($date->getTimestamp())->toBe($date1->getTimestamp()); |
167 | 167 | }); |
168 | 168 | |
169 | - it('ToDateTimeString', function () { |
|
169 | + it('ToDateTimeString', function() { |
|
170 | 170 | $date = Date::parse('2017-01-12 00:00'); |
171 | 171 | expect('2017-01-12 00:00:00')->toBe($date->toDateTimeString()); |
172 | 172 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | expect('2017-01-12 00:00:00')->toBe($date->toDateTimeString()); |
175 | 175 | }); |
176 | 176 | |
177 | - it('ToDateTimeStringWithTimeZone', function () { |
|
177 | + it('ToDateTimeStringWithTimeZone', function() { |
|
178 | 178 | $date = Date::parse('2017-01-12 00:00', 'Europe/London'); |
179 | 179 | $expect = new DateTime('2017-01-12', new DateTimeZone('Europe/London')); |
180 | 180 | |
@@ -182,58 +182,58 @@ discard block |
||
182 | 182 | }); |
183 | 183 | }); |
184 | 184 | |
185 | - describe('Date relatives', function () { |
|
186 | - it('Today', function () { |
|
185 | + describe('Date relatives', function() { |
|
186 | + it('Today', function() { |
|
187 | 187 | $date = Date::today(); |
188 | 188 | |
189 | 189 | expect(date('Y-m-d 00:00:00'))->toBe($date->toDateTimeString()); |
190 | 190 | }); |
191 | 191 | |
192 | - it('TodayLocalized', function () { |
|
192 | + it('TodayLocalized', function() { |
|
193 | 193 | $date = Date::today('Europe/London'); |
194 | 194 | |
195 | 195 | expect(date('Y-m-d 00:00:00'))->toBe($date->toDateTimeString()); |
196 | 196 | }); |
197 | 197 | |
198 | - it('Yesterday', function () { |
|
198 | + it('Yesterday', function() { |
|
199 | 199 | $date = Date::yesterday(); |
200 | 200 | |
201 | 201 | expect(date('Y-m-d 00:00:00', strtotime('-1 day')))->toBe($date->toDateTimeString()); |
202 | 202 | }); |
203 | 203 | |
204 | - it('Tomorrow', function () { |
|
204 | + it('Tomorrow', function() { |
|
205 | 205 | $date = Date::tomorrow(); |
206 | 206 | |
207 | 207 | expect(date('Y-m-d 00:00:00', strtotime('+1 day')))->toBe($date->toDateTimeString()); |
208 | 208 | }); |
209 | 209 | }); |
210 | 210 | |
211 | - describe('Creations', function () { |
|
212 | - it('CreateFromDate', function () { |
|
211 | + describe('Creations', function() { |
|
212 | + it('CreateFromDate', function() { |
|
213 | 213 | $date = Date::createFromDate(2017, 0o3, 0o5); |
214 | 214 | |
215 | 215 | expect(date('Y-m-d 00:00:00', strtotime('2017-03-05 00:00:00')))->toBe($date->toDateTimeString()); |
216 | 216 | }); |
217 | 217 | |
218 | - it('CreateFromDateLocalized', function () { |
|
218 | + it('CreateFromDateLocalized', function() { |
|
219 | 219 | $date = Date::createFromDate(2017, 0o3, 0o5, 'Europe/London'); |
220 | 220 | |
221 | 221 | expect(date('Y-m-d 00:00:00', strtotime('2017-03-05 00:00:00')))->toBe($date->toDateTimeString()); |
222 | 222 | }); |
223 | 223 | |
224 | - it('createFromTime', function () { |
|
224 | + it('createFromTime', function() { |
|
225 | 225 | $date = Date::createFromTime(10, 0o3, 0o5); |
226 | 226 | |
227 | 227 | expect(date('Y-m-d 10:03:05'))->toBe($date->toDateTimeString()); |
228 | 228 | }); |
229 | 229 | |
230 | - it('createFromTimeLocalized', function () { |
|
230 | + it('createFromTimeLocalized', function() { |
|
231 | 231 | $date = Date::createFromTime(10, 03, 05, 'Europe/London'); |
232 | 232 | |
233 | 233 | expect(date('Y-m-d 10:03:05'))->toBe($date->toDateTimeString()); |
234 | 234 | }); |
235 | 235 | |
236 | - it('createFromTimeEvening', function () { |
|
236 | + it('createFromTimeEvening', function() { |
|
237 | 237 | $date = Date::createFromTime(20, 03, 05); |
238 | 238 | |
239 | 239 | expect(date('Y-m-d 20:03:05'))->toBe($date->toDateTimeString()); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | expect(function() use ($router) { |
188 | 188 | $router->handle('admin/admins/edit/1'); |
189 | - })->toThrow(new RouterException( 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: \App/Admin/Admins::edit_show/$1')); |
|
189 | + })->toThrow(new RouterException('The namespace delimiter is a backslash (\), not a slash (/). Route handler: \App/Admin/Admins::edit_show/$1')); |
|
190 | 190 | }); |
191 | 191 | |
192 | 192 | it(': Route avec barre oblique en tête', function() { |
@@ -208,11 +208,11 @@ discard block |
||
208 | 208 | }); |
209 | 209 | |
210 | 210 | it(': Options de route', function() { |
211 | - $this->collection->add('foo', static function () {}, [ |
|
211 | + $this->collection->add('foo', static function() {}, [ |
|
212 | 212 | 'as' => 'login', |
213 | 213 | 'foo' => 'baz', |
214 | 214 | ]); |
215 | - $this->collection->add('baz', static function () {}, [ |
|
215 | + $this->collection->add('baz', static function() {}, [ |
|
216 | 216 | 'as' => 'admin', |
217 | 217 | 'foo' => 'bar', |
218 | 218 | ]); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | describe('Groupes et middlewares', function() { |
282 | 282 | it(': Le routeur fonctionne avec les middlewares', function() { |
283 | - $this->collection->group('foo', ['middleware' => 'test'], static function (RouteCollection $routes) { |
|
283 | + $this->collection->group('foo', ['middleware' => 'test'], static function(RouteCollection $routes) { |
|
284 | 284 | $routes->add('bar', 'TestController::foobar'); |
285 | 285 | }); |
286 | 286 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | 'namespace' => 'App\Controllers\Api', |
300 | 300 | 'middleware' => 'api-auth', |
301 | 301 | ], |
302 | - static function (RouteCollection $routes): void { |
|
302 | + static function(RouteCollection $routes): void { |
|
303 | 303 | $routes->resource('posts', [ |
304 | 304 | 'controller' => 'PostController', |
305 | 305 | ]); |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'active_adapter' => 'native' , |
|
5 | - 'compress_output' => 'auto' , |
|
6 | - 'view_base' => VIEW_PATH , |
|
7 | - 'debug' => 'auto' , |
|
4 | + 'active_adapter' => 'native', |
|
5 | + 'compress_output' => 'auto', |
|
6 | + 'view_base' => VIEW_PATH, |
|
7 | + 'debug' => 'auto', |
|
8 | 8 | 'shared' => fn(): array => [], |
9 | - 'decorators' => [] , |
|
9 | + 'decorators' => [], |
|
10 | 10 | 'adapters' => ['native' => ['extension' => 'php', 'save_data' => true]] |
11 | 11 | ]; |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'from' => ['address' => '[email protected]', 'name' => 'Example'], |
|
5 | - 'handler' => 'phpmailer', |
|
6 | - 'view_dir' => 'emails', |
|
7 | - 'template' => '', |
|
8 | - 'dsn' => '', |
|
9 | - 'protocol' => \BlitzPHP\Mail\Mail::PROTOCOL_SENDMAIL, |
|
10 | - 'host' => 'localhost', |
|
11 | - 'username' => '', |
|
12 | - 'password' => '', |
|
13 | - 'port' => 25, |
|
14 | - 'timeout' => 5, |
|
15 | - 'encryption' => \BlitzPHP\Mail\Mail::ENCRYPTION_NONE, |
|
16 | - 'mailType' => 'html', |
|
17 | - 'charset' => \BlitzPHP\Mail\Mail::CHARSET_UTF8, |
|
18 | - 'priority' => \BlitzPHP\Mail\Mail::PRIORITY_NORMAL, |
|
4 | + 'from' => ['address' => '[email protected]', 'name' => 'Example'], |
|
5 | + 'handler' => 'phpmailer', |
|
6 | + 'view_dir' => 'emails', |
|
7 | + 'template' => '', |
|
8 | + 'dsn' => '', |
|
9 | + 'protocol' => \BlitzPHP\Mail\Mail::PROTOCOL_SENDMAIL, |
|
10 | + 'host' => 'localhost', |
|
11 | + 'username' => '', |
|
12 | + 'password' => '', |
|
13 | + 'port' => 25, |
|
14 | + 'timeout' => 5, |
|
15 | + 'encryption' => \BlitzPHP\Mail\Mail::ENCRYPTION_NONE, |
|
16 | + 'mailType' => 'html', |
|
17 | + 'charset' => \BlitzPHP\Mail\Mail::CHARSET_UTF8, |
|
18 | + 'priority' => \BlitzPHP\Mail\Mail::PRIORITY_NORMAL, |
|
19 | 19 | ]; |