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

Changed the order of required vars PHP8 #18

Merged
merged 2 commits into from
Jun 10, 2022

Conversation

AzizKHAN030
Copy link
Member

@AzizKHAN030 AzizKHAN030 commented May 5, 2022

Fixes scandipwa/scandipwa#4122

Changed the position of required and optional(with default values) variables since this is a rule in PHP 8

  • Got an error in file /localmodules/cms-graphql/src/Model/Template/Filter.php that the required variables are declared after optional(with default values) since it is required in PHP 8

Comment in the task

Comment on lines 75 to 81
Widget $widget,
$variables = [],
array $directiveProcessors = [],
array $availableFilters,
array $widgetUnescapedParams,
array $widgetCustomParamsHandlers
array $widgetCustomParamsHandlers,
$variables = [],
array $directiveProcessors = []
) {

Choose a reason for hiding this comment

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

So you have changed the order of the parameters of the constructor.
But did you check where this class is created? Does it break since arguments are passed in the wrong order? :)

Choose a reason for hiding this comment

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

Optional arguments aren't necessary here.
Please return the order of arguments and remove the default values.
Then add a fallback for arguments, that had a default value, when you pass them to the parent constructor.
See the line 101 as the example.

@carinadues carinadues requested a review from zans-laksa June 9, 2022 17:27
@carinadues carinadues merged commit 2566d13 into scandipwa:master Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support for Magento 2.4.4
3 participants