Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function compile(Compiler $compiler)
 {
     $compiler->write('$mapper->extendType(')->string($this->parentTypeName)->raw(', ')->string($this->typeName)->raw(', ')->run(function () use($compiler) {
         $converter = null;
         if (isset($this->definition['options']['converter'])) {
             $converter = $this->definition['options']['converter'];
         }
         $compiler->repr($converter);
     })->raw(', ')->run(function () use($compiler) {
         $normalizer = null;
         if (isset($this->definition['options']['normalizer'])) {
             $normalizer = $this->definition['options']['normalizer'];
         }
         $compiler->repr($normalizer);
     })->raw(');');
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function compile(Compiler $compiler)
 {
     $compiler->raw('new \\')->raw($this->class)->raw('(')->each($this->arguments, function ($argument, Loop $loop) use($compiler) {
         $compiler->repr($argument);
         if ($loop->isNotLast()) {
             $compiler->raw(', ');
         }
     })->raw(')');
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 public function compile(Compiler $compiler)
 {
     $compiler->repr($this->value);
 }