overtrue / phplint

:bug: A tool that can speed up linting of php files by running several lint processes at once.
MIT License
972 stars 118 forks source link

PHP CS Fixer deprecated rules #193

Closed llaville closed 9 months ago

llaville commented 9 months ago

Fix all deprecated rules with latest PHP-CS-Fixer version 3.34.x

llaville commented 9 months ago

composer check-style command actually prints following result with main branch (07eba9a)

PHP CS Fixer 3.34.1 BerSzcz Saturnalia by Fabien Potencier and Dariusz Ruminski.
PHP runtime: 8.1.24
Loaded config default from ".php-cs-fixer.dist.php".
..........................F..............
Warning: declare(encoding=...) ignored because Zend multibyte feature is turned off by settings in  on line 12
.....                                                                                    46 / 46 (100%)
Legend: .-no changes, F-fixed, S-skipped (cached or empty file), I-invalid file syntax (file ignored), E-error
   1) src/Extension/OutputFormat.php (binary_operator_spaces)
      ---------- begin diff ----------
--- /shared/backups/github/phplint/src/Extension/OutputFormat.php
+++ /shared/backups/github/phplint/src/Extension/OutputFormat.php
@@ -50,7 +50,7 @@

     public function initFormat(ConsoleCommandEvent $event): void
     {
-        $command= $event->getCommand();
+        $command = $event->getCommand();
         if (!$command instanceof LintCommand) {
             // this extension must be only available for lint command
             return;

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

Found 1 of 46 files that can be fixed in 0.824 seconds, 16.000 MB memory used

Detected deprecations in use:
- Rule "braces" is deprecated. Use "single_space_around_construct", "control_structure_braces", "control_structure_continuation_position", "declare_parentheses", "no_multiple_statements_per_line", "curly_braces_position", "statement_indentation" and "no_extra_blank_lines" instead.
- Rule "compact_nullable_typehint" is deprecated. Use "compact_nullable_type_declaration" instead.
- Rule "function_typehint_space" is deprecated. Use "type_declaration_spaces" instead.
- Rule "new_with_braces" is deprecated. Use "new_with_parentheses" instead.
Script vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --using-cache=no --verbose --ansi --diff --dry-run handling the check-style event returned with error code 8