PHPPM\ClosureHelper::getPropertyAccessor PHP Method

getPropertyAccessor() public method

Return a closure that assigns a property value
public getPropertyAccessor ( $propertyName, $newValue )
    public function getPropertyAccessor($propertyName, $newValue)
    {
        return function () use($propertyName, $newValue) {
            $this->{$propertyName} = $newValue;
        };
    }
ClosureHelper