forked from erickskrauch/php-cs-fixer-custom-fixers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'erickskrauch:master' into feature/add-tests-php-84
- Loading branch information
Showing
5 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace ErickSkrauch\PhpCsFixer\Fixer; | ||
|
||
use PhpCsFixer\AbstractFixer; | ||
|
||
// PHP-CS-Fixer 3.59.3 has changed implementation of the AbstractFixer by removing method `configure` from it | ||
// and introducing a separate trait \PhpCsFixer\Fixer\ConfigurableFixerTrait with this method inside. | ||
// To mitigate these changes and maintain compatibility with older versions of PHP-CS-Fixer, this solution was created. | ||
// | ||
// Commit: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/commit/064efa1f#diff-e1fb45756cd1d53b6d67072d8a026692c07af55617018229b0bf4ab6c22e3e53L105 | ||
// See https://github.com/erickskrauch/php-cs-fixer-custom-fixers/issues/12 | ||
// @phpstan-ignore-next-line sometimes it exists, sometime it's not ;) | ||
if (method_exists(AbstractFixer::class, 'configure')) { | ||
trait ConfigurableFixerTrait { | ||
|
||
} | ||
} else { | ||
trait ConfigurableFixerTrait { | ||
use \PhpCsFixer\Fixer\ConfigurableFixerTrait; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters