Open deguif opened 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?
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:
Elastica\Query\BoolQuery
instead ofElastica\Query\Bool
previouslyElastica\Query\MatchQuery
instead ofElastica\Query\Match
previouslyElastica\Aggregation\GlobalAggregation
Elastica\Aggregation\ParentAggregation
Elastica\Processor\ForeachProcessor
in PR #1813I think it would be nice to standardise the suffix strategy by suffixing all classes from
Aggregation
,Query
andProcessor
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 likeElastica\Aggregration\AbstractAggregation
,Elastica\Query\AbstractQuery
,Elastica\Processor\AbstractProcessor
could take care of removing the suffix by overriding the method.What do you think?