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

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

11 May 2026 10:15PM UTC coverage: 23.529% (-0.6%) from 24.082%
25700513371

push

github

Enno Woortmann
Add ContentValidatorInterface and ContentException for content validator registry

Adds the opt-in content validator infrastructure introduced in Phase 5 of
the Draft 7 coverage work. Validator implementations throw on failure so
callers can access a meaningful error message via ContentException::getPrevious().

0 of 16 new or added lines in 1 file covered. (0.0%)

164 of 697 relevant lines covered (23.53%)

0.79 hits per line

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

0.0
/src/Exception/String/ContentException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace PHPModelGenerator\Exception\String;
6

7
use PHPModelGenerator\Exception\ValidationException;
8
use Throwable;
9

10
class ContentException extends ValidationException
11
{
NEW
12
    public function __construct(
×
13
        $providedValue,
14
        string $propertyName,
15
        protected ?string $expectedMediaType,
16
        protected ?string $expectedEncoding,
17
        ?Throwable $previous = null,
18
    ) {
NEW
19
        $description = implode(', ', array_filter([
×
NEW
20
            $this->expectedMediaType ? "mediaType {$this->expectedMediaType}" : null,
×
NEW
21
            $this->expectedEncoding ? "encoding {$this->expectedEncoding}" : null,
×
NEW
22
        ]));
×
23

NEW
24
        parent::__construct(
×
NEW
25
            "Value for $propertyName does not match the expected content ($description)",
×
NEW
26
            $propertyName,
×
NEW
27
            $providedValue,
×
NEW
28
            0,
×
NEW
29
            $previous,
×
NEW
30
        );
×
31
    }
32

NEW
33
    public function getExpectedMediaType(): ?string
×
34
    {
NEW
35
        return $this->expectedMediaType;
×
36
    }
37

NEW
38
    public function getExpectedEncoding(): ?string
×
39
    {
NEW
40
        return $this->expectedEncoding;
×
41
    }
42
}
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