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

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

19 Sep 2025 03:15PM UTC coverage: 18.962% (+5.0%) from 13.926%
17862408584

push

github

web-flow
Merge pull request #12 from wol-soft/BuilderClassPostProcessor

BuilderInterface

3 of 3 new or added lines in 1 file covered. (100.0%)

99 existing lines in 36 files now uncovered.

106 of 559 relevant lines covered (18.96%)

0.55 hits per line

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

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

3
declare(strict_types = 1);
4

5
namespace PHPModelGenerator\Exception\Arrays;
6

7
use PHPModelGenerator\Exception\ValidationException;
8

9
/**
10
 * Class InvalidTupleException
11
 *
12
 * @package PHPModelGenerator\Exception\Arrays
13
 */
14
class InvalidTupleException extends ValidationException
15
{
16
    /** @var ValidationException[][] */
17
    protected $invalidTuples;
18

19
    /**
20
     * InvalidTupleException constructor.
21
     *
22
     * @param $providedValue
23
     * @param string $propertyName
24
     * @param ValidationException[][] $invalidTuples
25
     */
UNCOV
26
    public function __construct($providedValue, string $propertyName, array $invalidTuples)
×
27
    {
28
        $this->invalidTuples = $invalidTuples;
×
29

30
        parent::__construct($this->getErrorMessage($propertyName), $propertyName, $providedValue);
×
31
    }
32

33
    /**
34
     * @return ValidationException[][]
35
     */
UNCOV
36
    public function getInvalidTuples(): array
×
37
    {
38
        return $this->invalidTuples;
×
39
    }
40

UNCOV
41
    protected function getErrorMessage(string $propertyName): string
×
42
    {
43
        $output = "Invalid tuple item in array $propertyName:";
×
44
        foreach ($this->invalidTuples as $tupleIndex => $exceptions) {
×
45
            $output .= "\n  - invalid tuple #$tupleIndex\n    * " .
×
46
                implode(
×
47
                    "\n    * ",
×
48
                    str_replace(
×
49
                        "\n",
×
50
                        "\n    ",
×
UNCOV
51
                        array_map(function (ValidationException $exception): string {
×
52
                            return $exception->getMessage();
×
53
                        }, $exceptions)
×
54
                    )
×
55
                );
×
56
        }
57

58
        return $output;
×
59
    }
60
}
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

© 2025 Coveralls, Inc