Skip to content

fix(core): fix preg_replace deprecation notice#1535

Merged
alecritson merged 1 commit intolunarphp:0.8from
se09deluca:fix/deprecation_preg_replace
Feb 9, 2024
Merged

fix(core): fix preg_replace deprecation notice#1535
alecritson merged 1 commit intolunarphp:0.8from
se09deluca:fix/deprecation_preg_replace

Conversation

@se09deluca
Copy link
Contributor

Fixes the deprecation warning: "Passing null to parameter #3 ($subject) of type array|string is deprecated"

As the notice says passing null as third parameter is deprecated. I simply bypassed the preg_replace.

Another option would be checking for null value and if so return a zero PriceDataType avoiding the validation and value casting.

I've choosen the first option in order to minimize the amount of duplicated code. If you prefer the second option for the small optimization that gives, i'll update the PR.

Fix notice: "Passing null to parameter lunarphp#3 ($subject) of type array|string is deprecated"
@vercel
Copy link

vercel bot commented Feb 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2024 8:46am

@alecritson alecritson merged commit e9f6395 into lunarphp:0.8 Feb 9, 2024
@se09deluca se09deluca deleted the fix/deprecation_preg_replace branch May 8, 2024 19:55
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