• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wol-soft / php-json-schema-model-generator-production / 28736035699

05 Jul 2026 09:19AM UTC coverage: 17.373% (-0.1%) from 17.482%
28736035699

push

github

wol-soft
Add jsonPointer arg to unevaluated + contains exceptions

Follow-up coordination after b484f42 landed jsonPointer on every
ValidationException subclass on master: five exception classes added
after that PR on the jsonSchemaDraft2019 branch — UnevaluatedItems,
UnevaluatedProperties, RegularPropertyAsUnevaluatedProperty,
MinContains, MaxContains — still used the pre-pointer three-arg
signature. Since AbstractPropertyValidator::getExceptionParams() on
the generator side now unconditionally prepends the pointer after the
property name, those constructors rejected the call as a TypeError
whenever the corresponding validator fired.

Constructors now follow the master-side ordering: providedValue,
propertyName, jsonPointer, keyword-specific fields. The parent
ValidationException receives jsonPointer as its fourth argument, so
getJsonPointer() returns the schema keyword location that produced
the rejection (e.g. /properties/tags/unevaluatedItems).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

0 of 15 new or added lines in 5 files covered. (0.0%)

5 existing lines in 5 files now uncovered.

168 of 967 relevant lines covered (17.37%)

0.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Exception/Arrays/UnevaluatedItemsException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace PHPModelGenerator\Exception\Arrays;
6

7
use PHPModelGenerator\Exception\ValidationException;
8

9
/**
10
 * Thrown when an array contains items at indices not evaluated by any sibling positive
11
 * applicator and the schema's `unevaluatedItems` keyword is `false`.
12
 */
13
class UnevaluatedItemsException extends ValidationException
14
{
15
    /**
16
     * @param int[] $unevaluatedItems Zero-based indices of the offending array entries.
17
     */
18
    public function __construct(
×
19
        mixed $providedValue,
20
        string $propertyName,
21
        string $jsonPointer,
22
        protected array $unevaluatedItems,
23
    ) {
24
        $formattedIndices = implode(
×
25
            ', ',
×
26
            array_map(
×
27
                static fn(int $index): string => '#' . $index,
×
28
                $unevaluatedItems,
×
29
            ),
×
30
        );
×
31

32
        parent::__construct(
×
33
            "Provided JSON for $propertyName contains not allowed unevaluated items "
×
34
                . "[$formattedIndices]",
×
35
            $propertyName,
×
36
            $providedValue,
×
NEW
37
            $jsonPointer,
×
UNCOV
38
        );
×
39
    }
40

41
    /**
42
     * @return int[]
43
     */
44
    public function getUnevaluatedItems(): array
×
45
    {
46
        return $this->unevaluatedItems;
×
47
    }
48
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc