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

chore: prepare release 2.3.4 #120

Merged
merged 3 commits into from
Aug 27, 2024
Merged

Conversation

phil-davis
Copy link
Contributor

The changes are mostly CI and tooling.
There are small code-style changes that the later php-cs-fixer applied, so I may as well release what is there.
The code is confirmed in CI that it passes with PHP 8.4

@phil-davis
Copy link
Contributor Author

phil-davis commented Aug 27, 2024

phpstan is complaining. I suppose that there is a newer version that finds more things.
It passed 2 hours ago in PR #117 with phpstan 1.11.8

And now there is phpstan 1.12.0 that reports problems.

The cause is:
phpstan/phpstan-src@bd2cec1

"Precise type for $matches from preg_match generally available"

phpstan is now smarter and knows what keys are guaranteed to end up in $matches from a call to preg_match
And so it is complaining about some of our code that does unnecessary isset() checks.

For now, I think that I will leave the v2 code as it is (overly self-protective) and ignore the phpstan messages.

@phil-davis
Copy link
Contributor Author

phil-davis commented Aug 27, 2024

phpstan passes on PHP 7.4, but on PHP 8.4 it says:
https://github.com/sabre-io/uri/actions/runs/10577749388/job/29306396107?pr=120

------ ------------------------------------------------------------------ 
  Line   lib/functions.php                                                 
 ------ ------------------------------------------------------------------ 
  353    Strict comparison using === between false and string will always  
         evaluate to false.                                                
  372    Strict comparison using === between false and string will always  
         evaluate to false.                                                
 ------ ------------------------------------------------------------------ 

And that is correct. Since PHP 8.0 the substr function always returns a string.
But in PHP 7.4 it could return false

https://www.php.net/manual/en/function.substr.php

I will ignore that too. I don't want to add complexity by checking the PHP version before bothering with the === checks.

@phil-davis phil-davis merged commit b76524c into sabre-io:v2 Aug 27, 2024
6 checks passed
@phil-davis phil-davis deleted the prepare-2.3.4 branch August 27, 2024 12:18
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