Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: workaround for php-cs-fixer 3.63 #9152

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Aug 27, 2024

Description

PHP CS Fixer 3.63.1 7th Gear by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.1.29
Running analysis on 4 cores with 10 files per process.
Parallel runner is an experimental feature and may be unstable, use it at your own risk. Feedback highly appreciated!
Loaded config CodeIgniter4 Coding Standards from ".php-cs-fixer.user-guide.php".
    0/1593 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%  160/1593 [▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░]  10%  319/1593 [▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░]  20%  478/1593 [▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░]  30%  638/1593 [▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░]  40%  797/1593 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░]  50%  956/1593 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░]  60% 1116/1593 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░]  70% 1275/1593 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░]  80% 1434/1593 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░]  90% 1593/1593 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

   1) /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/libraries/uri/009.php (fully_qualified_strict_types)
      ---------- begin diff ----------
--- /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/libraries/uri/009.php
+++ /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/libraries/uri/009.php
@@ -1,5 +1,5 @@
 <?php
 
-$uri = new \CodeIgniter\HTTP\URI('***example.com:21/some/path');
+$uri = new URI('***example.com:21/some/path');
 
 echo $uri->getAuthority();  // [email protected]:21

      ----------- end diff -----------

   2) /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/libraries/publisher/002.php (fully_qualified_strict_types)
      ---------- begin diff ----------
--- /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/libraries/publisher/002.php
+++ /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/libraries/publisher/002.php
@@ -1,3 +1,3 @@
 <?php
 
-$publisher = new \CodeIgniter\Publisher\Publisher();
+$publisher = new Publisher();

      ----------- end diff -----------

   3) /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/libraries/publisher/001.php (fully_qualified_strict_types)
      ---------- begin diff ----------
--- /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/libraries/publisher/001.php
+++ /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/libraries/publisher/001.php
@@ -1,3 +1,3 @@
 <?php
 
-$publisher = new \CodeIgniter\Publisher\Publisher();
+$publisher = new Publisher();

      ----------- end diff -----------

   4) /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/concepts/factories/009.php (fully_qualified_strict_types)
      ---------- begin diff ----------
--- /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/concepts/factories/009.php
+++ /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/concepts/factories/009.php
@@ -3,4 +3,4 @@
 $user = model('UserModel');
 
 // The code above is the same as the code below.
-$user = \CodeIgniter\Config\Factories::models('UserModel');
+$user = Factories::models('UserModel');

      ----------- end diff -----------

   5) /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/concepts/factories/008.php (fully_qualified_strict_types)
      ---------- begin diff ----------
--- /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/concepts/factories/008.php
+++ /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/concepts/factories/008.php
@@ -3,4 +3,4 @@
 $appConfig = config('App');
 
 // The code above is the same as the code below.
-$appConfig = \CodeIgniter\Config\Factories::config('App');
+$appConfig = Factories::config('App');

      ----------- end diff -----------


Found 5 of 1593 files that can be fixed in 1.913 seconds, 30.00 MB memory used
Script utils/vendor/bin/php-cs-fixer check --ansi --verbose --diff --config=.php-cs-fixer.user-guide.php handling the cs event returned with error code 8
Error: Process completed with exit code 8.

https://github.com/codeigniter4/CodeIgniter4/actions/runs/10569308633/job/29281890072?pr=9151

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis force-pushed the temp-fix-for-php-cs-fixer-3.63 branch from 5aa41b6 to 6eaaa60 Compare August 27, 2024 00:37
@kenjis
Copy link
Member Author

kenjis commented Aug 27, 2024

@paulbalandan I cannot reproduce these changes with a plain php-cs-fixer and the following files.

<?php

$uri = new \CodeIgniter\HTTP\URI('***example.com:21/some/path');
<?php

$finder = \PhpCsFixer\Finder::create()
    ->exclude('somedir')
    ->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php')
    ->in(__DIR__);
$config = new \PhpCsFixer\Config();

return $config->setRules([
    '@PSR12' => true,
    'fully_qualified_strict_types' => [
        'import_symbols'                        => false,
        'leading_backslash_in_global_namespace' => true,
    ],
])->setFinder($finder);
$ tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --diff
PHP CS Fixer 3.63.1 7th Gear by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.2.20
Running analysis on 1 core sequentially.
You can enable parallel runner and speed up the analysis! Please see usage docs for more information.
Loaded config default from "/Users/kenji/work/php/php-cs-fixer-test/.php-cs-fixer.php".
Using cache file ".php-cs-fixer.cache".
 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%


Fixed 0 of 1 files in 0.025 seconds, 14.00 MB memory used

@kenjis kenjis merged commit 8772496 into codeigniter4:develop Aug 27, 2024
3 checks passed
@kenjis kenjis deleted the temp-fix-for-php-cs-fixer-3.63 branch August 27, 2024 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants