ruflin / Elastica

Elastica is a PHP client for elasticsearch
http://elastica.io/
MIT License
2.26k stars 734 forks source link

Aggregation/Query/Processor class namings standardisation #1824

Open deguif opened 3 years ago

deguif commented 3 years ago

Previously some class were required to be named with a suffix to avoid conflicting with some reserved keywords. For examples these classes use different naming than others:

I think it would be nice to standardise the suffix strategy by suffixing all classes from Aggregation, Query and Processor namespaces. It could be done in a BC manner by creating a new class with the suffix part and making the previous class extends from it (which would trigger a deprecation too to help fixing it).

Regarding _getBaseName()method each base abstract class like Elastica\Aggregration\AbstractAggregation, Elastica\Query\AbstractQuery, Elastica\Processor\AbstractProcessor could take care of removing the suffix by overriding the method.

What do you think?

ruflin commented 3 years ago

I'm not a big fan of having the directory name repeated also in the class name itself. My hope initially was that this would be the exception, but it seems we have more and more use cases around it.

Is there any specific issue that triggered this or more generally to unify things?