/**
  * Get configuration by the given key.
  *
  * @param string $key
  *
  * @throws FileNotFoundException
  * @throws IOException
  *
  * @return array
  */
 public function get($key)
 {
     if (isset($this->config[$key])) {
         // if true, 'config' is also always set
         return $this->config[$key]['config'];
     }
     $conf = null;
     $file = $this->getFileNameForKey($key);
     // check if in cache
     if (null !== $this->cache) {
         $cacheKey = $this->getCacheKeyForFile($file);
         $conf = $this->app[$this->cache]->get($cacheKey);
         if (false !== $conf) {
             $this->config[$key] = ['config' => $conf, 'cacheKey' => $cacheKey];
             return $conf;
         }
     }
     // Load from file
     $conf = $this->loader->getConfig($file);
     $this->config[$key] = ['config' => $conf];
     // Store in the cache
     if (null !== $this->cache) {
         $this->config[$key]['cacheKey'] = $cacheKey;
         $this->app[$this->cache]->set($cacheKey, $conf);
     }
     return $conf;
 }