File tree Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ declare (strict_types=1 );
3
+
4
+ $ finder = PhpCsFixer \Finder::create ()
5
+ ->in ([
6
+ __DIR__ . '/framework ' ,
7
+ __DIR__ . '/controllers ' ,
8
+ __DIR__ . '/models ' ,
9
+ __DIR__ . '/views ' ,
10
+ __DIR__ . '/util ' ,
11
+ __DIR__ . '/classes ' ,
12
+ ])
13
+ ->name ('*.php ' );
14
+
15
+ return (new PhpCsFixer \Config ())
16
+ ->setFinder ($ finder )
17
+ ->setRules ([
18
+ 'nullable_type_declaration_for_default_null_value ' => true ,
19
+ ]);
20
+
21
+ foreach ($ finder as $ file ) {
22
+ echo $ file ->getRealPath () . PHP_EOL ;
23
+ }
Original file line number Diff line number Diff line change
1
+ ## Upgrade PHP Web MVC Framework to PHP >= 8.4
2
+
3
+ You can fix/upgrade PHP WEB MVC Framework to PHP 8.4 by eliminating the:
4
+
5
+ ** nullable_type_declaration_for_default_null_value**
6
+
7
+ used for backward compatibility with versions from PHP 7.1 to PHP 5.6.
8
+
9
+ To apply the fix if your runtime PHP enviroment is version is >= 7.1 run:
10
+
11
+ 1 )
12
+
13
+ ``` bash
14
+ composer require --dev friendsofphp/php-cs-fixer
15
+ ```
16
+
17
+ 2 ) If you are using PHP version 8.4 you must set the environment variable:
18
+
19
+ ** PHP_CS_FIXER_IGNORE_ENV=1**
20
+
21
+ On Windows just modify the file
22
+
23
+ ** .vendor\bin\php-cs-fixer.bat**
24
+
25
+ as follow:
26
+
27
+ ``` batch
28
+ @ECHO OFF
29
+ setlocal DISABLEDELAYEDEXPANSION
30
+ SET BIN_TARGET=%~dp0/php-cs-fixer
31
+ SET COMPOSER_RUNTIME_BIN_DIR=%~dp0
32
+ SET PHP_CS_FIXER_IGNORE_ENV=1
33
+ php "%BIN_TARGET%" %*
34
+ ```
35
+
36
+ 3 ) To check only, run:
37
+ ``` bash
38
+ .\v endor\b in\p hp-cs-fixer check
39
+ ```
40
+ 4 ) To fix run
41
+ ``` bash
42
+ .\v endor\b in\p hp-cs-fixer check
43
+ ```
44
+
45
+ Note: after applying the fix you can only use PHP version >= 7.1
You can’t perform that action at this time.
0 commit comments