zendframework / zend-ldap

Ldap component from Zend Framework
BSD 3-Clause "New" or "Revised" License
29 stars 29 forks source link

Removes default dependency to Zend\StdLib #21

Closed heiglandreas closed 8 years ago

heiglandreas commented 8 years ago

This commit removes the default dependency to the \Zend\StdLib\ErrorHandler by replacing it with a \Zend\Ldap\ErrorHandler that delegates the error handling to an injectable ErrorHandler.

That way the tests can use \Zend\StdLib\ErrorHandler and silence errors during the tests whereas in a live environment no error-suppression is used by default.

Other ErrorHandlers can be used by creating a class that implements \Zend\Ldap\ErrorHandlerInterface and injecting an instance of that class as ErrorHandler using \Zend\Ldap\ErrorHandler::setErrorHandler()

The main aim would be to get rid of external dependencies to make the component as independent as possible and allow a more widespread usage.

This has been influenced by zendframework/zf2#7497 and https://github.com/symfony/symfony-docs/issues/5756

felipsmartins commented 8 years ago

Looks nice!

gianarb commented 8 years ago

:+1: