Esempio n. 1
0
 /**
  * perform the actual binding, returning the InjectorBuilder that now contains the binding
  * @param $value
  * @return InjectorBuilder
  */
 private function bind($value)
 {
     $this->builder->builder()->addDefinitions([$this->key => $value]);
     return $this->builder;
 }
 public function configure(InjectorBuilder $builder)
 {
     global $wgConsulUrl, $wgConsulServiceTag;
     $builder->bind(UrlProvider::class)->toClass(ConsulUrlProvider::class)->bind(ConsulUrlProvider::BASE_URL)->to($wgConsulUrl)->bind(ConsulUrlProvider::SERVICE_TAG)->to($wgConsulServiceTag);
 }
 public function configure(InjectorBuilder $builder)
 {
     $builder->bind(PreferencePersistence::class)->toClass(PreferencePersistenceMySQL::class)->bind(PreferencePersistenceMySQL::CONNECTION_MASTER)->to($this->masterProvider)->bind(PreferencePersistenceMySQL::CONNECTION_SLAVE)->to($this->slaveProvider);
 }
Esempio n. 4
0
 private static function bindSwaggerService(InjectorBuilder $builder)
 {
     $builder->bind(PreferencePersistence::class)->toClass(PreferencePersistenceSwaggerService::class);
 }