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 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