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

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

23 Mar 2026 10:57PM UTC coverage: 20.543% (+0.8%) from 19.718%
23464244096

Pull #13

github

web-flow
Delete composer.lock
Pull Request #13: Upgrade to PHP 8.4 minimum and PHPUnit 13

4 of 67 new or added lines in 35 files covered. (5.97%)

43 existing lines in 30 files now uncovered.

106 of 516 relevant lines covered (20.54%)

0.6 hits per line

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

0.0
/src/Exception/ComposedValue/InvalidComposedValueException.php
1
<?php
2

3
declare(strict_types = 1);
4

5
namespace PHPModelGenerator\Exception\ComposedValue;
6

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

10
/**
11
 * Class InvalidComposedValueException
12
 *
13
 * @package PHPModelGenerator\Exception\ComposedValue
14
 */
15
abstract class InvalidComposedValueException extends ValidationException
16
{
17
    protected const COMPOSED_ERROR_MESSAGE = '';
18
    /**
19
     * InvalidComposedValueException constructor.
20
     *
21
     * @param $providedValue
22
     * @param ValidationException[][] $compositionErrorCollection
23
     */
24
    public function __construct(
×
25
        $providedValue,
26
        string $propertyName,
27
        protected int $succeededCompositionElements,
28
        protected array $compositionErrorCollection
29
    ) {
30
        parent::__construct($this->getErrorMessage($propertyName), $propertyName, $providedValue);
×
31
    }
32

UNCOV
33
    public function getSucceededCompositionElements(): int
×
34
    {
35
        return $this->succeededCompositionElements;
×
36
    }
37

38
    /**
39
     * @return ValidationException[][]
40
     */
41
    public function getCompositionErrorCollection(): array
×
42
    {
43
        return $this->compositionErrorCollection;
×
44
    }
45

46
    protected function getErrorMessage(string $propertyName): string
×
47
    {
48
        $compositionIndex = 0;
×
49

50
        return "Invalid value for $propertyName declined by composition constraint.\n  " .
×
51
            sprintf(static::COMPOSED_ERROR_MESSAGE, $this->succeededCompositionElements) .
×
52
            array_reduce(
×
53
                $this->compositionErrorCollection,
×
54
                function (string $carry, ErrorRegistryExceptionInterface $exception) use (&$compositionIndex): string {
×
55
                    return "$carry\n  - Composition element #" . ++$compositionIndex . (
×
56
                        $exception->getErrors()
×
57
                            ? ": Failed\n    * " .
×
58
                                implode(
×
59
                                    "\n    * ",
×
NEW
60
                                    array_map(fn(ValidationException $exception): string => $exception->getMessage(), $exception->getErrors())
×
61
                                )
×
62
                            : ': Valid'
×
63
                        );
×
64
                },
×
65
                ''
×
66
            );
×
67
    }
68
}
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