Skip to content

DX: re-apply PHP CS Fixer, partially #52398

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

Merged
merged 1 commit into from
Nov 1, 2023
Merged

Conversation

keradus
Copy link
Member

@keradus keradus commented Oct 31, 2023

Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? no
Issues Fix CS
License MIT

One further step to clean the CS status-quo, aiming for all-green in long-term.
~90 files remaining, yet they may require some further update on tool itself

best to review commit by commit

@keradus keradus requested a review from chalasr as a code owner October 31, 2023 22:13
@carsonbot carsonbot added this to the 6.4 milestone Oct 31, 2023
@@ -128,7 +128,7 @@ public static function hexToDateTime(string $time): \DateTimeImmutable

if (self::TIME_OFFSET_BIN <= $time) {
$time = self::add($time, self::TIME_OFFSET_COM2);
$time[0] = $time[0] & "\x7F";
$time[0] &= "\x7F";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, this is not the same for string indexes. Would need double checking if this was fixed in recent versions of PHP.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the string index here? (not the [0], right?)

It is causing CI to fail, let's revert for now indeed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it is, same for the other similar changes in the PR

Copy link
Member Author

@keradus keradus Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the same for string indexes.

can you elaborate on that string index a bit? I'm not aware what is the underlying issue here.

same for the other similar changes in the PR

after revert ot &= , CI is green (ok, except of fabbot for file license-headers)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule marked as risky, at least: PHP-CS-Fixer/PHP-CS-Fixer#7418
perhaps, with time we can have better detection if we touch index or not

@nicolas-grekas
Copy link
Member

Thank you @keradus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants