Файл: concrete5.7.5.6/concrete/vendor/zendframework/zend-stdlib/src/Hydrator/HydratorPluginManager.php
Строк: 68
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace ZendStdlibHydrator;
use ZendServiceManagerAbstractPluginManager;
use ZendStdlibException;
/**
* Plugin manager implementation for hydrators.
*
* Enforces that adapters retrieved are instances of HydratorInterface
*/
class HydratorPluginManager extends AbstractPluginManager
{
/**
* Whether or not to share by default
*
* @var bool
*/
protected $shareByDefault = false;
/**
* Default set of adapters
*
* @var array
*/
protected $invokableClasses = array(
'arrayserializable' => 'ZendStdlibHydratorArraySerializable',
'classmethods' => 'ZendStdlibHydratorClassMethods',
'objectproperty' => 'ZendStdlibHydratorObjectProperty',
'reflection' => 'ZendStdlibHydratorReflection'
);
/**
* {@inheritDoc}
*/
public function validatePlugin($plugin)
{
if ($plugin instanceof HydratorInterface) {
// we're okay
return;
}
throw new ExceptionRuntimeException(sprintf(
'Plugin of type %s is invalid; must implement ZendStdlibHydratorHydratorInterface',
(is_object($plugin) ? get_class($plugin) : gettype($plugin))
));
}
}