[PropertyAccess] Simplified code
minor #12292 [PropertyAccess] Simplified code (webmozart)

This PR was merged into the 2.5 branch.

Discussion
----------

[PropertyAccess] Simplified code

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12275
| License       | MIT
| Doc PR        | -

Makes implementation of #10882 more readable.

Simplifies `camelize()` as pointed out in #12275.

Commits
-------

b712ac1 [PropertyAccess] Simplified code