Nelmio\Alice\Definition\Property::withValue PHP Method

withValue() public method

param ValueInterface|mixed $value
public withValue ( $value ) : self
return self
    public function withValue($value) : self
    {
        $clone = clone $this;
        $clone->value = $value;
        return $clone;
    }

Usage Example

Ejemplo n.º 1
0
 public function testWithersReturnNewModifiedInstance()
 {
     $name = 'username';
     $definition = new Property($name, 'foo');
     $newDefinition = $definition->withValue(new \stdClass());
     $this->assertEquals(new Property($name, 'foo'), $definition);
     $this->assertEquals(new Property($name, new \stdClass()), $newDefinition);
 }
All Usage Examples Of Nelmio\Alice\Definition\Property::withValue