pimcore icon indicating copy to clipboard operation
pimcore copied to clipboard

[Improvement]: use plural for variables and methods where needed

Open passioneight opened this issue 3 years ago • 1 comments

Improvement description

As a concrete example, here's the getMarker method, which returns an array of markers:

https://github.com/pimcore/pimcore/blob/b675696e8c3dff29e51d97e67fc79d3003c9ca3a/models/DataObject/Data/Hotspotimage.php#L119

So, renaming the method to getMarkers would be great, but this would introduce a BC. Should we just introduce a BC with v11, or add an additional method and a deprecation warning?

Note that the corresponding variable, namely $this->marker, should also be renamed (to $this->markers).

Another place: https://github.com/pimcore/pimcore/blob/b675696e8c3dff29e51d97e67fc79d3003c9ca3a/models/Document/Editable/Image.php#L747

Additionally, maybe we shouldn't return null where applicable, but an empty array. This could avoid code like this: image.markers|default([]).

passioneight avatar Jul 23 '22 12:07 passioneight

needs also deprecation of old methods of course.

fashxp avatar Jul 25 '22 07:07 fashxp

Dear community, it's been a while since that issue was updated the last time, so we decided to close it for now. If you're still interested in contributing, feel free to add comments here or contact us before creating a pull request to discuss next steps.

Thanks for your understanding.

fashxp avatar Dec 21 '23 09:12 fashxp