• 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/MinContainsException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace PHPModelGenerator\Exception\Arrays;
6

7
use PHPModelGenerator\Exception\ValidationException;
8

9
class MinContainsException extends ValidationException
10
{
11
    public function __construct(
×
12
        array $providedValue,
13
        string $propertyName,
14
        string $jsonPointer,
15
        protected int $minContains,
16
        protected int $matches,
17
    ) {
18
        parent::__construct(
×
19
            sprintf(
×
NEW
20
                'Array %s must not contain less than %d items matching the contains constraint,'
×
NEW
21
                    . ' %s matching items provided',
×
22
                $propertyName,
×
23
                $this->minContains,
×
24
                $this->matches,
×
25
            ),
×
26
            $propertyName,
×
NEW
27
            $providedValue,
×
NEW
28
            $jsonPointer,
×
UNCOV
29
        );
×
30
    }
31

32
    public function getMinContains(): int
×
33
    {
34
        return $this->minContains;
×
35
    }
36

37
    public function getMatches(): int
×
38
    {
39
        return $this->matches;
×
40
    }
41
}
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