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

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

16 Sep 2025 02:21PM UTC coverage: 98.287% (-0.3%) from 98.564%
17768946986

Pull #92

github

Enno Woortmann
remove unnecessary function
Pull Request #92: BuilderClassPostProcessor

123 of 135 new or added lines in 9 files covered. (91.11%)

4 existing lines in 1 file now uncovered.

3385 of 3444 relevant lines covered (98.29%)

564.05 hits per line

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

96.3
/src/PropertyProcessor/Property/AbstractValueProcessor.php
1
<?php
2

3
declare(strict_types = 1);
4

5
namespace PHPModelGenerator\PropertyProcessor\Property;
6

7
use PHPModelGenerator\Exception\SchemaException;
8
use PHPModelGenerator\Model\Property\Property;
9
use PHPModelGenerator\Model\Property\PropertyInterface;
10
use PHPModelGenerator\Model\Property\PropertyType;
11
use PHPModelGenerator\Model\Schema;
12
use PHPModelGenerator\Model\SchemaDefinition\JsonSchema;
13
use PHPModelGenerator\PropertyProcessor\Filter\FilterProcessor;
14
use PHPModelGenerator\PropertyProcessor\PropertyMetaDataCollection;
15
use PHPModelGenerator\SchemaProcessor\SchemaProcessor;
16
use ReflectionException;
17

18
/**
19
 * Class AbstractScalarValueProcessor
20
 *
21
 * @package PHPModelGenerator\PropertyProcessor\Property
22
 */
23
abstract class AbstractValueProcessor extends AbstractPropertyProcessor
24
{
25
    /**
26
     * AbstractValueProcessor constructor.
27
     */
28
    public function __construct(
1,915✔
29
        PropertyMetaDataCollection $propertyMetaDataCollection,
30
        SchemaProcessor $schemaProcessor,
31
        Schema $schema,
32
        private string $type = '',
33
    ) {
34
        parent::__construct($propertyMetaDataCollection, $schemaProcessor, $schema);
1,915✔
35
    }
36

37
    /**
38
     * @inheritdoc
39
     *
40
     * @throws ReflectionException
41
     * @throws SchemaException
42
     */
43
    public function process(string $propertyName, JsonSchema $propertySchema): PropertyInterface
1,902✔
44
    {
45
        $json = $propertySchema->getJson();
1,902✔
46

47
        $property = (new Property(
1,902✔
48
            $propertyName,
1,902✔
49
            $this->type ? new PropertyType($this->type) : null,
1,902✔
50
            $propertySchema,
1,902✔
51
            $json['description'] ?? '',
1,902✔
52
        ))
1,902✔
53
            ->setRequired($this->propertyMetaDataCollection->isAttributeRequired($propertyName))
1,902✔
54
            ->setReadOnly(
1,902✔
55
                (isset($json['readOnly']) && $json['readOnly'] === true) ||
1,902✔
56
                (isset($json['readonly']) && $json['readonly'] === true) ||
1,902✔
57
                $this->schemaProcessor->getGeneratorConfiguration()->isImmutable(),
1,902✔
58
            );
1,902✔
59

60
        if (isset($json['readOnly'])) {
1,901✔
NEW
61
            trigger_error('Change from readOnly to readonly for property "' . $propertyName . '".', E_USER_DEPRECATED);
×
62
        }
63

64
        $this->generateValidators($property, $propertySchema);
1,901✔
65

66
        if (isset($json['filter'])) {
1,897✔
67
            (new FilterProcessor())->process(
108✔
68
                $property,
108✔
69
                $json['filter'],
108✔
70
                $this->schemaProcessor->getGeneratorConfiguration(),
108✔
71
                $this->schema,
108✔
72
            );
108✔
73
        }
74

75
        return $property;
1,878✔
76
    }
77
}
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