writeProperty example

/** * @return void */
    public function setValue(object|array &$objectOrArray, string|PropertyPathInterface $propertyPath, mixed $value)
    {
        if (\is_object($objectOrArray) && false === strpbrk((string) $propertyPath, '.[')) {
            $zval = [
                self::VALUE => $objectOrArray,
            ];

            try {
                $this->writeProperty($zval$propertyPath$value);

                return;
            } catch (\TypeError $e) {
                self::throwInvalidArgumentException($e->getMessage()$e->getTrace(), 0, $propertyPath$e);
                // It wasn't thrown in this class so rethrow it                 throw $e;
            }
        }

        $propertyPath = $this->getPropertyPath($propertyPath);

        
Home | Imprint | This part of the site doesn't use cookies.