Skip to content

ambiguous nomenclature in ClassMethodsHydrator::hydrate() #50

@pine3ree

Description

@pine3ree

(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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions