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

Continue project cleanup #194

Merged
merged 14 commits into from
Jan 20, 2025
Merged

Continue project cleanup #194

merged 14 commits into from
Jan 20, 2025

Conversation

lkrms
Copy link
Owner

@lkrms lkrms commented Jan 19, 2025

No description provided.

lkrms added 3 commits January 19, 2025 19:51
- Add blank lines after loosely-spaced declarations so comments cannot
  appear on the next line
- Allow for comments between DocBlocks and subsequent declarations when
  checking input spacing and suppressing blank lines
- Don't always add a blank line between declarations separated by
  comments other than DocBlocks
- Remove `Formatter::getTokens()` in favour of access via
  `Formatter::$Document`
- Narrow type returned via `FormatterException::getData()`
Copy link

codecov bot commented Jan 19, 2025

Codecov Report

Attention: Patch coverage is 93.19728% with 10 lines in your changes missing coverage. Please review.

Project coverage is 95.93%. Comparing base (9730250) to head (9f30054).
Report is 17 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/Parser.php 62.50% 6 Missing ⚠️
src/App/PrettyPHPCommand.php 80.00% 1 Missing ⚠️
src/Filter/EvaluateStrings.php 50.00% 1 Missing ⚠️
src/Filter/NormaliseBinaryStrings.php 88.88% 1 Missing ⚠️
src/Formatter.php 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main     #194   +/-   ##
=========================================
  Coverage     95.93%   95.93%           
- Complexity     2812     2826   +14     
=========================================
  Files            68       69    +1     
  Lines          7177     7203   +26     
=========================================
+ Hits           6885     6910   +25     
- Misses          292      293    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

lkrms added 11 commits January 20, 2025 12:21
- Move code into an `Updater` class
- Add tests from `nikic/php-parser`
- Remove non-advisory code validation in case the PHP version running
  the script is not compatible with versions targeted by listings
- Update `update-out-fixtures.php` for consistency
- Clean up `.gitattributes` in fixture directory
Necessary to prevent exceptions like `Deprecated: The (real) cast is
deprecated, use (float) instead`
e.g. import statements like `use A\B\{C\D, function b\c, const D};`
Binary prefixes will be removed from all strings in a future update.
They are already removed from constant strings if `simplify-strings` is
enabled.
- Add `NormaliseBinaryStrings` to assign the same token ID to the
  opening delimiter of strings like `b"$foo"` as on PHP >= 8.0
This fixes issues with inconsistent output when code contains multiple
line endings.
@lkrms lkrms merged commit 298b772 into main Jan 20, 2025
26 of 27 checks passed
@lkrms lkrms deleted the cleanup branch January 20, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant