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

Remove default values from method signatures #78

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

glensc
Copy link
Contributor

@glensc glensc commented Mar 15, 2021

As optional before required params are forbidden in PHP 8.0 these signatures
needed to be changed and the functionality of the method adapted
accordingly to still retain the original behavior.

Moved out of #67,
which was moved out from #32

@glensc glensc changed the title Removed default values from method signatures Remove default values from method signatures Mar 15, 2021
@glensc
Copy link
Contributor Author

glensc commented Mar 15, 2021

I would have personally just filled defaults to the rest of the arguments as null.

Copy link
Member

@falkenhawk falkenhawk left a comment

Choose a reason for hiding this comment

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

Looking at the code, the rest of arguments are required and they can't be null for the components to work properly.

Since values of $genNum and $queueName are validated anyway, I'd just remove the defaults and not change any logic inside method bodies. Would that be okay with you?

I suspect the default values on those arguments could be just unintended leftovers. 🤷‍♂️

@glensc glensc marked this pull request as draft March 15, 2021 12:12
Copy link
Member

@falkenhawk falkenhawk left a comment

Choose a reason for hiding this comment

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

Is it okay to merge this?

@glensc
Copy link
Contributor Author

glensc commented Mar 15, 2021

Is it okay to merge this?

@falkenhawk you requested changes, I have not reviewed these, so marked back as Draft.

As optional before required params is forbidden in PHP 8.0 these signatures
needed to be changed and the functionality of the method adapted
accordingly to still retain the original behaviour.

Signed-off-by: Alexander Wozniak <wozniak@oktopos.com>
Signed-off-by: Elan Ruusamäe <glen@pld-linux.org>
@glensc glensc marked this pull request as ready for review March 15, 2021 15:30
@glensc
Copy link
Contributor Author

glensc commented Mar 15, 2021

Rebased and applied proposed fixes. Removed Draft

@falkenhawk falkenhawk merged commit c959345 into zf1s:master Mar 15, 2021
@glensc glensc deleted the optional-args branch March 15, 2021 20:10
@glensc glensc mentioned this pull request Mar 16, 2021
32 tasks
@glensc glensc mentioned this pull request Aug 7, 2021
@glensc glensc mentioned this pull request Sep 10, 2021
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