public function visitProviderMethod(ProviderMethodBinding $binding)
 {
     $method = $binding->getMethod();
     foreach ($binding->getDependencies() as $name => $dependency) {
         try {
             $dependency->accept($this);
         } catch (ConfigurationException $e) {
             throw new ConfigurationException($e->getMessage() . ", required by parameter \$" . $name . " in " . $method->getType()->name . "::" . $method->name);
         }
     }
 }
 public function visitProviderMethod(ProviderMethodBinding $providerMethod)
 {
     $method = $providerMethod->getMethod();
     $method->isStatic() ? $this->writer->write($method->getType()->name, "::", $method->name) : $this->writer->write('$m[', $providerMethod->getIndex(), ']->', $method->name);
     $this->writer->write("(");
     $dependencies = $providerMethod->getDependencies();
     if ($dependencies) {
         $this->writer->indent();
         array_shift($dependencies)->accept($this);
         foreach ($dependencies as $dependency) {
             $this->writer->writeln(", ");
             $dependency->accept($this);
         }
         $this->writer->outdent();
     }
     $this->writer->write(")");
 }
Beispiel #3
0
 public function visitProviderMethod(ProviderMethodBinding $providerMethod)
 {
     foreach ($providerMethod->getDependencies() as $dependency) {
         $dependency->accept($this);
     }
 }