private function createWrittingDelegate()
    {
        return $this->writeDelegate ?: $this->writeDelegate = function (PropertyPathInterface $property, $value, PropertyAccessor $propertyAccessor) {
            switch (true) {

                // Public property / accessor case
                case $propertyAccessor->isWritable($this, $property) :
                    return $propertyAccessor->setValue($this, $property, $value);

                // Private property / StdClass
                case property_exists($this, $property) || $this instanceof \StdClass :
                    return $this->$property = $value;
            }

            throw new InvalidScopeException(sprintf(
                'Unable to set "%s" property into a "%s" object, any existing property path to write it in.',
                $property,
                get_class($this)
            ));
        };
    }
private function createWrittingDelegate()
    {
        return $this->writeDelegate ?: $this->writeDelegate = function (PropertyPathInterface $property, $value, PropertyAccessor $propertyAccessor) {
            switch (true) {

                // Public property / accessor case
                case $propertyAccessor->isWritable($this, $property) :
                    return $propertyAccessor->setValue($this, $property, $value);

                // Private property / StdClass
                case property_exists($this, $property) || $this instanceof \StdClass :
                    return $this->$property = $value;
            }

            throw new InvalidScopeException(sprintf(
                'Unable to set "%s" property into a "%s" object, any existing property path to write it in.',
                $property,
                get_class($this)
            ));
        };
    }
private function createWrittingDelegate ( ) { return $ this -> writeDelegate ? : $ this -> writeDelegate = function ( PropertyPathInterface $ property , $ value , PropertyAccessor $ propertyAccessor ) { switch ( true ) { // Public property / accessor case case $ propertyAccessor -> isWritable ( $ this , $ property ) : return $ propertyAccessor -> setValue ( $ this , $ property , $ value ) ; // Private property / StdClass case property_exists ( $ this , $ property ) || $ this instanceof \ StdClass : return $ this -> $ property = $ value ; } throw new InvalidScopeException ( sprintf ( 'Unable to set "%s" property into a "%s" object, any existing property path to write it in.' , $ property , get_class ( $ this ) ) ) ; } ; }
Create and return a Closure available to write an object property through a property path or a private property.

@return \Closure
Create and return a Closure available to write an object property through a property path or a private property .