for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Ivory CKEditor package.
*
* (c) Eric GELOEN <[email protected]>
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/
namespace Ivory\CKEditorBundle\Model;
use Ivory\CKEditorBundle\Exception\PluginManagerException;
/**
* @author GeLo <[email protected]>
class PluginManager implements PluginManagerInterface
{
* @var array
private $plugins = [];
* @param array $plugins
public function __construct(array $plugins = [])
$this->setPlugins($plugins);
}
* {@inheritdoc}
public function hasPlugins()
return !empty($this->plugins);
public function getPlugins()
return $this->plugins;
public function setPlugins(array $plugins)
foreach ($plugins as $name => $plugin) {
$this->setPlugin($name, $plugin);
public function hasPlugin($name)
return isset($this->plugins[$name]);
public function getPlugin($name)
if (!$this->hasPlugin($name)) {
throw PluginManagerException::pluginDoesNotExist($name);
return $this->plugins[$name];
public function setPlugin($name, array $plugin)
$this->plugins[$name] = $plugin;