Skip to content
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

[CLEANUP] Autoformat the code #749

Merged
merged 1 commit into from
Oct 31, 2024
Merged

[CLEANUP] Autoformat the code #749

merged 1 commit into from
Oct 31, 2024

Conversation

oliverklee
Copy link
Contributor

This is the v8.x backport of #748.

Copy link
Contributor

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

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

I'm sure PHP-Fixer added the spaces after cast operators (somewhat against my taste). So we shouldn't be removing them again.

There's a string with arbitrary whitespace that needs manual post-reformatting to make it readable again.

Shouldn't the autoformat be done first on main?

Comment on lines 47 to 48
',
],
Copy link
Contributor

Choose a reason for hiding this comment

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

The leading and trailing whitespace is arbitrary, and for readability. So the string content and closing quote should now be futher indented.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -39,7 +39,7 @@ public function parsesArithmeticInFunctions($operator)
{
$subject = Value::parseValue(new ParserState('max(300px, 50vh ' . $operator . ' 10px);', Settings::create()));

self::assertSame('max(300px,50vh ' . $operator . ' 10px)', (string) $subject);
self::assertSame('max(300px,50vh ' . $operator . ' 10px)', (string)$subject);
Copy link
Contributor

Choose a reason for hiding this comment

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

This surely contradicts PHP-Fixer, which added spaces after casts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@oliverklee
Copy link
Contributor Author

Shouldn't the autoformat be done first on main?

Yes: #748

I'll mark this PR here as draft for now and do the corresponding changes there.

@oliverklee oliverklee marked this pull request as draft October 27, 2024 08:01
@oliverklee oliverklee force-pushed the backport/autoformat branch 2 times, most recently from 1d5e320 to 7745173 Compare October 27, 2024 17:21
@oliverklee oliverklee marked this pull request as ready for review October 31, 2024 14:28
This is the v8.x backport of #748.
@JakeQZ JakeQZ merged commit 6098bee into v8.x Oct 31, 2024
25 checks passed
@JakeQZ JakeQZ deleted the backport/autoformat branch October 31, 2024 17:21
westonruter added a commit to westonruter/PHP-CSS-Parser that referenced this pull request Nov 4, 2024
…into fix/malformed-identifier

* 'v8.x' of https://github.com/MyIntervals/PHP-CSS-Parser: (46 commits)
  [CLEANUP] Autoformat the code (MyIntervals#749)
  [TASK] Prepare the 8.7.0 release (MyIntervals#742)
  [BUGFIX] Fix another implictly nullable parameter (MyIntervals#751)
  [CLEANUP] Autoformat the changelog (MyIntervals#750)
  [TASK] Configure PHPUnit to be more strict (MyIntervals#744)
  [BUGFIX] Avoid implicit nullable parameters (MyIntervals#746)
  [BUGFIX] Revert broken support for multiple comments (MyIntervals#741)
  [TASK] Add some more tests for parsing comments (MyIntervals#739)
  [TASK] Use fixed PHPUnit versions (MyIntervals#726)
  [TASK] Update PHPUnit (MyIntervals#725)
  [TASK] State since which version code is `@internal`/`@deprecated` (MyIntervals#723)
  [TASK] Deprecate the expansion of shorthand properties (MyIntervals#719)
  [TASK] Mark parsing-internal classes and methods as `@internal` (MyIntervals#711)
  [TASK] Deprecate `Parser::setCharset()` and `Parser::getCharset()` (MyIntervals#703)
  [FEATURE] Run the tests on CI with PHP 8.4 as well (MyIntervals#701)
  [TASK] Run the tests with PHP versions up to 8.3 (MyIntervals#697)
  [TASK] Also allow higher versions of PHPUnit (MyIntervals#682)
  [BUGFIX] Fix type errors in PHP strict mode (MyIntervals#695)
  [TASK] Block installations on unsupported higher PHP versions (MyIntervals#692)
  [BUGFIX] Avoid using `setUp()` in testcases (MyIntervals#683)
  ...
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.

2 participants