isUninitializedValueError example

$attributeContext = $this->getAttributeNormalizationContext($object$attribute$context);

            try {
                $attributeValue = $this->getAttributeValue($object$attribute$format$attributeContext);
            } catch (UninitializedPropertyException $e) {
                if ($context[self::SKIP_UNINITIALIZED_VALUES] ?? $this->defaultContext[self::SKIP_UNINITIALIZED_VALUES] ?? true) {
                    continue;
                }
                throw $e;
            } catch (\Error $e) {
                if (($context[self::SKIP_UNINITIALIZED_VALUES] ?? $this->defaultContext[self::SKIP_UNINITIALIZED_VALUES] ?? true) && $this->isUninitializedValueError($e)) {
                    continue;
                }
                throw $e;
            }

            if ($maxDepthReached) {
                $attributeValue = $maxDepthHandler($attributeValue$object$attribute$format$attributeContext);
            }

            $stack[$attribute] = $this->applyCallbacks($attributeValue$object$attribute$format$attributeContext);
        }

        
$attributeContext = $this->getAttributeNormalizationContext($object$attribute$context);

            try {
                $attributeValue = $this->getAttributeValue($object$attribute$format$attributeContext);
            } catch (UninitializedPropertyException $e) {
                if ($context[self::SKIP_UNINITIALIZED_VALUES] ?? $this->defaultContext[self::SKIP_UNINITIALIZED_VALUES] ?? true) {
                    continue;
                }
                throw $e;
            } catch (\Error $e) {
                if (($context[self::SKIP_UNINITIALIZED_VALUES] ?? $this->defaultContext[self::SKIP_UNINITIALIZED_VALUES] ?? true) && $this->isUninitializedValueError($e)) {
                    continue;
                }
                throw $e;
            }

            if ($maxDepthReached) {
                $attributeValue = $maxDepthHandler($attributeValue$object$attribute$format$attributeContext);
            }

            $stack[$attribute] = $this->applyCallbacks($attributeValue$object$attribute$format$attributeContext);
        }

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