protected function getInstanceConfig($instanceId = 0)
    {
        /** @var \Rcm\Service\PluginManager $pluginManager */
        $pluginManager = $this->getServiceLocator()->get(
            'Rcm\Service\PluginManager'
        );

        $instanceConfig = [];

        $pluginName = $this->getRcmPluginName();

        if ($instanceId > 0) {
            try {
                $instanceConfig = $pluginManager->getInstanceConfig($instanceId);
            } catch (PluginInstanceNotFoundException $e) {
                // ignore error
            }
        }

        if (empty($instanceConfig)) {
            $instanceConfig = $pluginManager->getDefaultInstanceConfig(
                $pluginName
            );
        }

        return $instanceConfig;
    }