-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
DX: PHP CS Fixer - update excluded paths and apply some minor CS #52117
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
Conversation
@@ -29,7 +29,7 @@ class CoverageListener implements TestListener | |||
public function __construct(callable $sutFqcnResolver = null, bool $warningOnSutNotFound = false) | |||
{ | |||
$this->sutFqcnResolver = $sutFqcnResolver ?? static function (Test $test): ?string { | |||
$class = \get_class($test); | |||
$class = $test::class; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes in the PHPUnit bridge need to be reverted as it still supports PHP 7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, reverted.
then, I strongly encourage to disable the rule, as one cannot apply current Fixer config in such case and trust to use the results.
aadeffb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we would need would be to be able to disable some rules only for some paths. But php-cs-fixer does not support this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very open to see such PR.
Yet, for now, if John Doe comes, see the Fixer config, apply it and see lot of changes needed, and those changes breaking CI, it's very confusing.
@@ -38,8 +38,6 @@ class GenericMetadata implements MetadataInterface | |||
public array $constraints = []; | |||
|
|||
/** | |||
* @var array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest updating it to array<string, list<Constraint>>
to have the precise type instead of removing the type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure. automate dropped the pointless type hint. if you have better one, happy to add it.
also looking at other annotations around those properties, they use Constraint[]
, let's be consistent on it - i followed what's already present
de34f51
Thank you @keradus. |
@@ -96,7 +96,7 @@ public static function collectDeprecations($outputFile) | |||
{ | |||
$deprecations = []; | |||
$previousErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$deprecations, &$previousErrorHandler) { | |||
if (\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type && (\E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break'))) { | |||
if (\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type && (\E_WARNING !== $type || !str_contains($msg, '" targeting switch is equivalent to "break'))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm reverting all those, the phpunit-bridge doesn't support php and we don't want it to use polyfills
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolas-grekas , i'm curious then, as bridge is already using 8.1 polyfill. Why not using 8.0 polyfill ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After checking, this is needed for testing the enum_exists mock. Also, this is require-dev!
…hs and apply some minor CS" (nicolas-grekas) This PR was merged into the 6.4 branch. Discussion ---------- Partially revert "DX: PHP CS Fixer - update excluded paths and apply some minor CS" | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT This partially reverts #52117 Commits ------- 8511198 Partially revert "DX: PHP CS Fixer - update excluded paths and apply some minor CS"
Uh oh!
There was an error while loading. Please reload this page.