Skip to content

chore: adjust code for cs-fixer no-useless-else#144

Merged
phil-davis merged 1 commit intosabre-io:masterfrom
phil-davis:no-useless-else
Mar 24, 2026
Merged

chore: adjust code for cs-fixer no-useless-else#144
phil-davis merged 1 commit intosabre-io:masterfrom
phil-davis:no-useless-else

Conversation

@phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Mar 24, 2026

php-cs-fixer 3.93 (among many other things) added a fixer for no-useless-else

PHP-CS-Fixer/PHP-CS-Fixer#9340

Let php-cs-fixer get rid of these useless else blocks.

No change to behaviour, so no need to release.

@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.18%. Comparing base (3b64d4b) to head (26e5fbd).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
lib/Promise.php 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master     #144   +/-   ##
=========================================
  Coverage     99.18%   99.18%           
  Complexity      111      111           
=========================================
  Files             7        7           
  Lines           370      370           
=========================================
  Hits            367      367           
  Misses            3        3           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@phil-davis
Copy link
Contributor Author

phil-davis commented Mar 24, 2026

The uncovered line is in Promise wait(), the very bottom line that throws LogicException()
A LogicException thrown higher up is covered by a test that purposely uses a Promise of nothing.
The last LogicExcetion looks difficult to get that code to execute, so difficult to cover.

@phil-davis phil-davis merged commit 0b40bc9 into sabre-io:master Mar 24, 2026
8 of 9 checks passed
@phil-davis phil-davis deleted the no-useless-else branch March 24, 2026 08:59
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