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

Shorten SelectFields constructor using array unpacking #648

Merged
merged 2 commits into from
Jun 30, 2020

Conversation

kylekatarnls
Copy link
Contributor

@kylekatarnls kylekatarnls commented Jun 30, 2020

Summary

Syntax proposal: usage of array unpacking

Benefits:

  • Avoid intermediate variable
  • Avoid magic numbers 0 and 1
  • Avoid ambiguous 'fields' name: fields[0] (which make think the first field only goes to select and the second one to relations while it's actually 2 groups of different things that have been retrieved and the unit is not the field)
  • Solve a PHPStan error

Type of change

Misc. change (syntax)

@mfn mfn merged commit 8d8f81c into rebing:master Jun 30, 2020
@mfn
Copy link
Collaborator

mfn commented Jun 30, 2020

Thank you @kylekatarnls !

@kylekatarnls kylekatarnls deleted the array-unpacking branch June 30, 2020 20:17
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.

None yet

2 participants