Closed FelixTHG closed 11 months ago
In a fresh Laravel 10 Application with the example code put into "app/Rules/E164PhoneNumber.php" and then running the command vendor/bin/pint
nothing happens.
Can you provide an example repository? Or do you have custom rules in your pint.json
Note: I use PHP 8.2.11 instead of PHP 8.2.5 (on MacOS)
Sorry, I guess I was a little quick.
you will have to change your class defining line to be like this:
class E164PhoneNumber implements Rule, DataAwareRule //, ValidatorAwareRule
Having it like so, gives me the bug, after doing a fresh laravel install (was in a more complex project earlier)
using the changed code from you, I can confirm the issue.
using this pint.json
{
"rules": {
"ordered_interfaces": false
}
}
you can for now disable this behaviour, but this is an issue with PHP-CS-Fixer where you should report the problem.
Thanks @Jubeki
@FelixTHG feel free to report this to PHP CS Fixer 👍
Fix released by Fixer team 🎉
for cross reference: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/7463#issuecomment-1826127122
btw folks, in some previous conversations we got lot of involvement of Laravel community pointing not big enough discussion, alignments etc - root cause is limited pool of contributors. Please, take it as good opportunity here - in future cases when you go deep dive to figure out which rule is having the problem, you may not only delegate the issue to core repo, but also contribute to repo with the fix 🙏🏻
Pint Version
1.13.6
PHP Version
8.2.5
Description
We have a validation rule that implements use Illuminate\Contracts\Validation\DataAwareRule; use Illuminate\Contracts\Validation\Rule;
we had commented out that the rule should implement Illuminate\Contracts\Validation\ValidatorAwareRule at the end of the implements line; like so:
class E164PhoneNumber implements DataAwareRule, Rule //, ValidatorAwareRule
when we format this file using pint fresh as is, it puts the "Rule" into the comment, breaking our validation.
Steps To Reproduce
Install pint on a laravel 10 project used composer require laravel/pint
create a rule file like so:
use pint to format the file by running ./vendor/bin/pint