zendframework / zend-code

BSD 3-Clause "New" or "Revised" License
1.68k stars 79 forks source link

ParserInterface segregation #157

Closed spalax closed 6 years ago

spalax commented 6 years ago

Hello everybody.

Have some problem with ParserInterface. If i would have a custom implementation and method signature for the registerAnnotation, or do not want to have registerAnnotations it is not affect the Parser functionality, so why it is defined in ParserInterface ? Additionally it is really miss used in AnnotationManager.php, only one method required to make the Parser attachable to the EventManager, but method signature requires to implement whole interface.

So i would suggest to split this interface to few more specific. And for BC, i would suggest to not remove ParserInterface but do inheritance inside it, to inherit a two more specific contracts.

What do you think ?

Ocramius commented 6 years ago

@spalax the entire parser stuff is gone from develop, so I'd not suggest relying on it ;-)