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

ambiguous nomenclature in ClassMethodsHydrator::hydrate() #50

Open
pine3ree opened this issue Feb 7, 2021 · 0 comments
Open

ambiguous nomenclature in ClassMethodsHydrator::hydrate() #50

pine3ree opened this issue Feb 7, 2021 · 0 comments
Labels
Bug Something isn't working

Comments

@pine3ree
Copy link
Contributor

pine3ree commented Feb 7, 2021

(I am not sure about the issue category for this, so I first wish to apologize for using the "bug-report" type)

In line:

$propertyFqn = $objectClass . '::$' . $property;

$property is actually a key in the $data array, so it may be a snake-cased key like first_name for a matching setter setFirstName for an object's property firstName. The real property name can often be obtained by calling hydrateName($name) (...but it could also be different from camelCase conventional names).

Wouldn't it be better to rename $property to $name (or $key, but $name is used elsewhere) and $propertyFqn to something like $cacheKey or $fqSetterKey? I know this is a trivial matter, but when I first read $property my mind automatically associated it with the $object despite the foreach loop...

kind regards

(for this repo's team reviewers...if unuseful please feel free to close this issue at once...no explanation needed)

@pine3ree pine3ree added the Bug Something isn't working label Feb 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant