mirror of
https://github.com/shlinkio/shlink.git
synced 2026-08-03 09:53:00 -05:00
22 lines
617 B
PHP
22 lines
617 B
PHP
<?php
|
|
namespace Shlinkio\Shlink\Common\ErrorHandler;
|
|
|
|
use Zend\ServiceManager\AbstractPluginManager;
|
|
use Zend\ServiceManager\Exception\InvalidServiceException;
|
|
|
|
class ErrorHandlerManager extends AbstractPluginManager implements ErrorHandlerManagerInterface
|
|
{
|
|
public function validate($instance)
|
|
{
|
|
if (is_callable($instance)) {
|
|
return;
|
|
}
|
|
|
|
throw new InvalidServiceException(sprintf(
|
|
'Only callables are valid plugins for "%s". "%s" provided',
|
|
__CLASS__,
|
|
is_object($instance) ? get_class($instance) : gettype($instance)
|
|
));
|
|
}
|
|
}
|