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

Fix PHP str_replace call with parameter #3 is null deprecation #1568

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

simonberger
Copy link

Q A
Branch? 2.x
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
License MIT

When the cache_prefix is not set for the flysystem resolver, it results in

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

in the FlysystemV2Resolver while fixing I saw the same should happen for the AwsS3Resolver.

There are multiple ways to fix this easily. I decided to do it very early by changing the default value of the configuration property, because null also already violated the doctype string of the parameter in the resolvers.

Copy link
Member

@dbu dbu left a comment

Choose a reason for hiding this comment

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

thanks! we could alternatively check in the DI extension if the prefix is non-null and otherwise not do the str_replace at all.

with only changing the defaults, the user could still configure the values to null in their config. but i consider this good enough for now.

@dbu
Copy link
Member

dbu commented Feb 23, 2024

we have a test on the configuration handling that is now failing. can you please adjust the test?

@simonberger
Copy link
Author

Sure, I'll fix the tests this evening.
If I understood the upgrade log of 3.0 correctly this part is gone anyway (I might be wrong, but at least I could not find comparable code there on a quick look), which is why I also did not consider a more in-depth PR.

@dbu
Copy link
Member

dbu commented Feb 23, 2024

thanks. the flysystem should still be around, but legacy aws is removed.

I hope that we can actually remove all the remote storage things in favor of flysystem - could well be that we change a lot more there. so fully agree to not do more on 2.x 👍

@coveralls
Copy link

Coverage Status

coverage: 82.018%. remained the same
when pulling a877cbb on simonberger:patch-deprecation
into 80a51e8 on liip:2.x.

@dbu
Copy link
Member

dbu commented Feb 23, 2024

thanks a lot!

@dbu dbu merged commit 23483e8 into liip:2.x Feb 23, 2024
29 of 30 checks passed
@dbu
Copy link
Member

dbu commented Feb 23, 2024

https://github.com/liip/LiipImagineBundle/releases/tag/2.12.2

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.

3 participants