Skip to content

chore: update to phpstan major version 2#255

Merged
phil-davis merged 4 commits into
sabre-io:masterfrom
phil-davis:phpstan-2.1
Apr 27, 2026
Merged

chore: update to phpstan major version 2#255
phil-davis merged 4 commits into
sabre-io:masterfrom
phil-davis:phpstan-2.1

Conversation

@phil-davis
Copy link
Copy Markdown
Contributor

@phil-davis phil-davis commented Jan 6, 2025

Issue #254

After this is reviewed and merged, I will look at doing similar in the 6.0 branch also.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.21%. Comparing base (5c9a800) to head (4386c45).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #255   +/-   ##
=========================================
  Coverage     94.21%   94.21%           
+ Complexity      264      263    -1     
=========================================
  Files            15       15           
  Lines           881      881           
=========================================
  Hits            830      830           
  Misses           51       51           

☔ 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.

Comment thread lib/Message.php
Comment on lines 88 to +86
$contentLength = $this->getHeader('Content-Length');
if (null !== $contentLength && (is_int($contentLength) || ctype_digit($contentLength))) {
if (null !== $contentLength && ctype_digit($contentLength)) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

getHeader can only return string or null. So is_int() is useless code.

Comment on lines 202 to +203
$test = preg_match('/^AWS$/', $this->response->getHeader('WWW-Authenticate'), $matches);
self::assertTrue(true == $test, 'The WWW-Authenticate response didn\'t match our pattern');
self::assertTrue(1 === $test, 'The WWW-Authenticate response didn\'t match our pattern');
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

preg_match returns (int) 1 not (bool) true.

$this->response->getHeader('WWW-Authenticate'), $matches);

self::assertTrue(true == $test, 'The WWW-Authenticate response didn\'t match our pattern. We received: '.$this->response->getHeader('WWW-Authenticate'));
self::assertTrue(1 === $test, 'The WWW-Authenticate response didn\'t match our pattern. We received: '.$this->response->getHeader('WWW-Authenticate'));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

preg_match returns (int) 1 not (bool) true.


/**
* @backupGlobals
* @backupGlobals enabled
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

backupGlobals should explicitly have the keyword "enabled"

Copy link
Copy Markdown
Member

@staabm staabm Jan 6, 2025

Choose a reason for hiding this comment

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

Did this annotation work as expected in phpunit without the suffix? If not we might just drop it

Comment thread phpstan.neon
@phil-davis phil-davis force-pushed the phpstan-2.1 branch 2 times, most recently from 1778353 to e9e5ed0 Compare April 27, 2026 06:18
@phil-davis phil-davis merged commit c7a728f into sabre-io:master Apr 27, 2026
9 checks passed
@phil-davis phil-davis deleted the phpstan-2.1 branch April 27, 2026 06: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.

2 participants