_configCacheType = $configCacheType; $this->_configReader = $configReader; $this->serializer = $serializer ?: ObjectManager::getInstance()->get(SerializerInterface::class); } /** * Return integrations loaded from cache if enabled or from files merged previously * * @return array * @api */ public function getIntegrations() { if (null === $this->_integrations) { $integrations = $this->_configCacheType->load(self::CACHE_ID); if ($integrations && is_string($integrations)) { $this->_integrations = $this->serializer->unserialize($integrations); } else { $this->_integrations = $this->_configReader->read(); $this->_configCacheType->save( $this->serializer->serialize($this->_integrations), self::CACHE_ID, [TypeIntegration::CACHE_TAG] ); } } return $this->_integrations; } }