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

Fixed (?) method name? #11766

Merged
merged 1 commit into from
Oct 27, 2022
Merged

Fixed (?) method name? #11766

merged 1 commit into from
Oct 27, 2022

Conversation

snipe
Copy link
Owner

@snipe snipe commented Sep 1, 2022

This should never have worked. How did this work? We literally do not have a method by that (case-sensitive) name.

@snipe snipe requested a review from uberbrady September 1, 2022 02:24
@snipe snipe changed the title Literally have no idea how this ever worked Fixed (?) method name? Oct 5, 2022
Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

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

Okay, I've actually tested this in Tinker. This is Laravel 'magic' - it apparently will allow either one, regardless of capitalization. But, regardless of Laravel allowing it, this corrected capitalization is more correct.

My test, in Tinker:

>>> $a->assignedTo
=> App\Models\Location {#5711
     id: 4,
     name: "Kaleighshire",
     city: "South Jamiebury",
     state: "OH",
     country: "VC",
     created_at: "2022-09-12 19:48:10",
     updated_at: "2022-09-12 19:48:10",
     #user_id: null,
     address: "6903 Blanda Center",
     address2: "Apt. 519",
     zip: "41133",
     deleted_at: null,
     parent_id: null,
     currency: "SAR",
     ldap_ou: null,
     manager_id: null,
     image: "7.jpg",
   }

>>> $a->assignedto
=> App\Models\Location {#5713
     id: 4,
     name: "Kaleighshire",
     city: "South Jamiebury",
     state: "OH",
     country: "VC",
     created_at: "2022-09-12 19:48:10",
     updated_at: "2022-09-12 19:48:10",
     #user_id: null,
     address: "6903 Blanda Center",
     address2: "Apt. 519",
     zip: "41133",
     deleted_at: null,
     parent_id: null,
     currency: "SAR",
     ldap_ou: null,
     manager_id: null,
     image: "7.jpg",
   }

>>> $a->AssIgNeDTO
=> App\Models\Location {#5715
     id: 4,
     name: "Kaleighshire",
     city: "South Jamiebury",
     state: "OH",
     country: "VC",
     created_at: "2022-09-12 19:48:10",
     updated_at: "2022-09-12 19:48:10",
     #user_id: null,
     address: "6903 Blanda Center",
     address2: "Apt. 519",
     zip: "41133",
     deleted_at: null,
     parent_id: null,
     currency: "SAR",
     ldap_ou: null,
     manager_id: null,
     image: "7.jpg",
   }

>>> 

So I think this fix is innocuous in terms of the damage it would cause, and is much more correct and consistent with the software as a whole. So I'll take it, thank you!

@snipe snipe merged commit 7cb4740 into develop Oct 27, 2022
@snipe snipe deleted the fixes/wtf_method_names_derp branch October 27, 2022 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants