addViolation('Expected object.', 'invalid_type'); return $value; } if (\array_key_exists('$type', $object) && $object['$type'] !== $this->type) { $context->withPath('$type', fn (ValidationContext $child) => $child->addViolation( \sprintf('Expected "%s".', $this->type), 'type_mismatch', )); } return $this->object->validateValue($value, $context); } }