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 8: declare required args before optional args #900

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

uday-kokitkar
Copy link

Fixes PHP deprecation in v8.0.0.
PHP Deprecated: Required parameter $submit_text follows optional parameter $list in yikes-inc-easy-mailchimp-extender/public/helpers.php on line 14

More about function arguments: https://www.php.net/manual/en/functions.arguments.php

@uday-kokitkar uday-kokitkar changed the title declare required args before optional args PHP 8: declare required args before optional args Sep 27, 2022
@uday-kokitkar uday-kokitkar changed the title PHP 8: declare required args before optional args Fix PHP 8: declare required args before optional args Sep 27, 2022
@uday-kokitkar
Copy link
Author

uday-kokitkar commented Sep 27, 2022

Re-opening the PR. I found that the function yksemeProcessSnippet is not being used by this plugin anywhere. I can see in the doc block that it was written to support legacy PHP snippets.
So wherever those snippets are present, and calls to this function are happening, change in the arguments order is necessary.

I have set the default value of $submit_text to null. PHP isset returns false to null values. No need to change the arguments sequence.

@uday-kokitkar uday-kokitkar reopened this Sep 27, 2022
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