• 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

95.24
/src/PropertyProcessor/Property/ReferenceProcessor.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace PHPModelGenerator\PropertyProcessor\Property;
6

7
use Exception;
8
use PHPModelGenerator\Exception\SchemaException;
9
use PHPModelGenerator\Model\Property\PropertyInterface;
10
use PHPModelGenerator\Model\SchemaDefinition\JsonSchema;
11
use PHPModelGenerator\PropertyProcessor\Decorator\SchemaNamespaceTransferDecorator;
12

13
/**
14
 * Class ReferenceProcessor
15
 *
16
 * @package PHPModelGenerator\PropertyProcessor\Property
17
 */
18
class ReferenceProcessor extends AbstractTypedValueProcessor
19
{
20
    /**
21
     * @inheritdoc
22
     *
23
     * @throws SchemaException
24
     */
25
    public function process(string $propertyName, JsonSchema $propertySchema): PropertyInterface
529✔
26
    {
27
        $path = [];
529✔
28
        $reference = $propertySchema->getJson()['$ref'];
529✔
29
        $dictionary = $this->schema->getSchemaDictionary();
529✔
30

31
        try {
32
            $definition = $dictionary->getDefinition($reference, $this->schemaProcessor, $path);
529✔
33

34
            if ($definition) {
522✔
35
                if (
36
                    $this->schema->getClassPath() !== $definition->getSchema()->getClassPath() ||
522✔
37
                    $this->schema->getClassName() !== $definition->getSchema()->getClassName() ||
522✔
38
                    (
39
                        $this->schema->getClassName() === 'ExternalSchema' &&
522✔
40
                        $definition->getSchema()->getClassName() === 'ExternalSchema'
522✔
41
                    )
42
                ) {
43
                    $this->schema->addNamespaceTransferDecorator(
243✔
44
                        new SchemaNamespaceTransferDecorator($definition->getSchema()),
243✔
45
                    );
243✔
46
                }
47

48
                return $definition->resolveReference($propertyName, $path, $this->propertyMetaDataCollection);
522✔
49
            }
50
        } catch (Exception $exception) {
7✔
51
            throw new SchemaException(
7✔
52
                "Unresolved Reference $reference in file {$propertySchema->getFile()}",
7✔
53
                0,
7✔
54
                $exception,
7✔
55
            );
7✔
56
        }
57

UNCOV
58
        throw new SchemaException("Unresolved Reference $reference in file {$propertySchema->getFile()}");
×
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

© 2026 Coveralls, Inc