public function init(ChainManagerInterface $chainManager, array $params = [])
    {
        $this->in($chainManager->getAssetManager());

        if ($chainManager->hasEvents()) {
            $event = $chainManager->getNextEvent();
            if (is_object($event)) {
                $event->init($chainManager);
            }
        }

        $this->out($chainManager->getAssetManager());

        return $this;
    }