for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* MtMail - e-mail module for Zend Framework 2
*
* @link http://github.com/mtymek/MtMail
* @copyright Copyright (c) 2013-2014 Mateusz Tymek
* @license BSD 2-Clause
*/
namespace MtMail\Service;
use MtMail\Exception\RuntimeException;
use MtMail\SenderPlugin\PluginInterface;
use Zend\ServiceManager\AbstractPluginManager;
use Zend\ServiceManager\Exception;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\ServiceManager\ServiceManager;
class SenderPluginManager extends AbstractPluginManager
{
* The main service locator
* @var ServiceLocatorInterface
protected $serviceLocator;
* Validate the plugin
* @param mixed $plugin
* @throws RuntimeException
* @return void
public function validatePlugin($plugin)
if (!$plugin instanceof PluginInterface) {
throw new RuntimeException(sprintf(
'Plugin of type %s is invalid; must implement %s\FilterInterface or be callable',
(is_object($plugin) ? get_class($plugin) : gettype($plugin)),
__NAMESPACE__
));
}
* sm v3
public function validate($plugin)
$this->validatePlugin($plugin);
* Canonicalize name
* @param string $name
* @return string
protected function canonicalizeName($name)
return $name;