code: public function registerPlugin(PluginInterface $plugin)
      {
          $plugin->register($this);
  
          $this->plugins[] = $plugin;
  
          return $this;
      }
docs: Registers plugin and add to list.
  @param  PluginInterface $plugin PluginInterface object.
  @return self