Skip to content

Fix PHP 8: declare required args before optional args#900

Open
uday-kokitkar wants to merge 2 commits intoEvanHerman:masterfrom
uday-kokitkar:master
Open

Fix PHP 8: declare required args before optional args#900
uday-kokitkar wants to merge 2 commits intoEvanHerman:masterfrom
uday-kokitkar:master

Conversation

@uday-kokitkar
Copy link
Copy Markdown

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
Copy Markdown
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