pimcore
pimcore copied to clipboard
[Improvement]: use plural for variables and methods where needed
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([]).
needs also deprecation of old methods of course.
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.