public function generateBindedParameter($name, CodeWriter $writer) { if (empty($name)) { $writer->write('iterator_to_array($rq)'); } else { $writer->write('$rq['); $writer->literal($name); $writer->write(']'); } }
public function generateMethodCall(Method $method, CodeWriter $writer) { $writer->write('$i'); if ($this->isTypeBinded($method)) { $writer->write('->fork([new self($rq)])'); } $writer->write('->getInstance('); $writer->literal($method->getType()->name); $writer->write(')->', $method->name); }
public function writeTypedBinding(Type $class, $name, CodeWriter $writer) { $writer->write('is_array($b['); $writer->literal($name); $writer->write(']) ? $d->newInstance('); $writer->literal($class->name); $writer->write(', $b['); $writer->literal($name); $writer->write(']) : $d->find('); $writer->literal($class->name); $writer->write(', $b['); $writer->literal($name); $writer->write('])'); }
public function generateParameter(Parameter $parameter, CodeWriter $writer) { if ($parameter->getClass()) { $writer->write($parameter->getClass()->name, " "); } else { if ($parameter->isArray()) { $writer->write("array "); } } $writer->write('$', $parameter->name); if ($parameter->isDefaultValueAvailable()) { $writer->write(" = "); $writer->literal($parameter->getDefaultValue()); } }