public function ExtensionPluginManager::validatePlugin in Zircon Profile 8
Same name in this branch
- 8 vendor/zendframework/zend-feed/src/Reader/ExtensionPluginManager.php \Zend\Feed\Reader\ExtensionPluginManager::validatePlugin()
- 8 vendor/zendframework/zend-feed/src/Writer/ExtensionPluginManager.php \Zend\Feed\Writer\ExtensionPluginManager::validatePlugin()
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-feed/src/Reader/ExtensionPluginManager.php \Zend\Feed\Reader\ExtensionPluginManager::validatePlugin()
Validate the plugin
Checks that the extension loaded is of a valid type.
Parameters
mixed $plugin:
Return value
void
Throws
Exception\InvalidArgumentException if invalid
File
- vendor/
zendframework/ zend-feed/ src/ Reader/ ExtensionPluginManager.php, line 60
Class
- ExtensionPluginManager
- Plugin manager implementation for feed reader extensions based on the AbstractPluginManager.
Namespace
Zend\Feed\ReaderCode
public function validatePlugin($plugin) {
if ($plugin instanceof Extension\AbstractEntry || $plugin instanceof Extension\AbstractFeed) {
// we're okay
return;
}
throw new Exception\InvalidArgumentException(sprintf('Plugin of type %s is invalid; must implement %s\\Extension\\AbstractFeed ' . 'or %s\\Extension\\AbstractEntry', is_object($plugin) ? get_class($plugin) : gettype($plugin), __NAMESPACE__, __NAMESPACE__));
}