public function addPlugin(PluginInterface $plugin, $name = null) {
		if ($name === null) {
			$this->plugins[] = $plugin;
			
			return $this;
		}
		
		$this->plugins[$name] = $plugin;
		
		return $this;
	}