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

wol-soft / php-json-schema-model-generator / 23323674448

20 Mar 2026 12:32AM UTC coverage: 98.663% (+0.005%) from 98.658%
23323674448

Pull #118

github

web-flow
Merge ef6187e70 into f7c94aa3c
Pull Request #118: Upgrade to PHP 8.4 minimum and PHPUnit 13

431 of 436 new or added lines in 54 files covered. (98.85%)

22 existing lines in 8 files now uncovered.

3690 of 3740 relevant lines covered (98.66%)

556.09 hits per line

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

92.31
/src/PropertyProcessor/Decorator/TypeHint/ArrayTypeHintDecorator.php
1
<?php
2

3
declare(strict_types = 1);
4

5
namespace PHPModelGenerator\PropertyProcessor\Decorator\TypeHint;
6

7
use PHPModelGenerator\Model\Property\PropertyInterface;
8

9
/**
10
 * Class ArrayTypeHintDecorator
11
 *
12
 * @package PHPModelGenerator\PropertyProcessor\Decorator\Property
13
 */
14
class ArrayTypeHintDecorator implements TypeHintDecoratorInterface
15
{
16
    private int $recursiveArrayCheck = 0;
17

18
    public function __construct(protected PropertyInterface $nestedProperty) {}
430✔
19

20
    /**
21
     * @inheritdoc
22
     */
23
    public function decorate(string $input, bool $outputType = false): string
422✔
24
    {
25
        // TODO: provide better type hints. Currently provides e.g. "string|array[]" instead of "string|string[]" for a recursive string array
26
        if (++$this->recursiveArrayCheck > 1) {
422✔
NEW
27
            return $this->nestedProperty->getTypeHint($outputType, [self::class]);
×
28
        }
29

30
        $result = implode(
422✔
31
            '|',
422✔
32
            array_map(
422✔
33
                static fn(string $typeHint): string => "{$typeHint}[]",
422✔
34
                explode('|', $this->nestedProperty->getTypeHint($outputType)),
422✔
35
            )
422✔
36
        );
422✔
37

38
        $this->recursiveArrayCheck--;
422✔
39

40
        return $result;
422✔
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