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

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

23 Mar 2026 01:55PM UTC coverage: 98.584% (-0.001%) from 98.585%
23440965067

Pull #118

github

Enno Woortmann
Merge fix/issue-110 into chore/phpunit-13-upgrade

Brings in patternProperties type intersection, PSR-12 code style
enforcement, PropertyMerger API refactor, and all related tests and
documentation. Resolved conflicts by keeping readonly constructors and
PHP 8.4+ style from this branch, applying phpcbf to align opening
braces with the PSR-12 rule. Added squizlabs/php_codesniffer to
require-dev alongside phpunit ^13.0.
Pull Request #118: Upgrade to PHP 8.4 minimum and PHPUnit 13

508 of 517 new or added lines in 54 files covered. (98.26%)

23 existing lines in 9 files now uncovered.

3828 of 3883 relevant lines covered (98.58%)

548.12 hits per line

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

92.86
/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
    {}
430✔
20

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

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

40
        $this->recursiveArrayCheck--;
422✔
41

42
        return $result;
422✔
43
    }
44
}
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