Inheritance: implements Nelmio\Alice\Definition\ValueInterface
示例#1
0
 public function testIsImmutable()
 {
     $arguments = [$arg0 = new \stdClass()];
     $value = new FunctionCallValue('setUsername', $arguments);
     // Mutate injected value
     $arg0->foo = 'bar';
     // Mutate returned value
     $value->getArguments()[0]->foo = 'baz';
     $this->assertEquals([new \stdClass()], $value->getArguments());
     $this->assertEquals(['setUsername', [new \stdClass()]], $value->getValue());
 }
示例#2
0
 /**
  * @inheritdoc
  */
 public function __toString() : string
 {
     return sprintf('%s->%s(%s)', $this->reference, $this->function->getName(), [] === $this->function->getArguments() ? '' : var_export($this->function->getArguments(), true));
 }