/**
  * {@inheritdoc}
  */
 public function provides($alias = null)
 {
     $this->provides = array_map(function ($key) {
         return $this->key . '.' . $key;
     }, $this->getProvided());
     return parent::provides($alias);
 }
 public function provides($alias = null)
 {
     if (!count($this->provides)) {
         $this->provides = $this->defaultProvides;
         $adapterNames = array_keys($this->getConfig());
         foreach ($adapterNames as $name) {
             $this->provides[] = 'flysystem.adapter.' . $name;
         }
     }
     return parent::provides($alias);
 }
Пример #3
0
 public function provides($alias = null)
 {
     if (!count($this->provides)) {
         $this->provides = $this->defaultProvides;
         try {
             $connections = $this->getContainer()->get('config')['connections'];
             if (!is_array($connections) || count($connections) === 0) {
                 throw new \Exception();
             }
         } catch (\Exception $e) {
             throw new RuntimeException('To use SpotProvider, you must add an array of connections to the container using the key "config.connections".');
         }
         foreach ($connections as $connection) {
             $this->provides[] = 'spot.config.' . $connection['name'];
             $this->provides[] = 'spot.locator.' . $connection['name'];
         }
     }
     return parent::provides($alias);
 }