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

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

01 Jun 2026 05:41PM UTC coverage: 22.282% (-1.2%) from 23.529%
26771556525

push

github

wol-soft
Add accessor classes and default serialization methods for Phase 3

- Add ImmutableAdditionalPropertiesAccessor (get/getAll only, readonly array)
- Add AdditionalPropertiesAccessor (mutable, required setter/remover closures)
  Closures are used for mutation because set/remove must invoke model-specific
  validation logic (base validators, minProperties, rawModelDataInput update)
  which varies per schema and cannot be expressed as a generic interface on the
  production lib class.
- Add PatternPropertiesAccessor (get only, array reference to backing field)
- Add Meta (rawInput() via array reference to _rawModelDataInput)
- Update SerializableTrait._getValues to call _serializeAdditionalProperties and
  _serializePatternProperties directly via property_exists() checks, removing
  the serialization hook as the vehicle for these concerns
- Add default _serializeAdditionalProperties and _serializePatternProperties to
  the trait; generated classes override _serializeAdditionalProperties only when
  a transforming filter requires it

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2 of 48 new or added lines in 5 files covered. (4.17%)

166 of 745 relevant lines covered (22.28%)

0.75 hits per line

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

0.0
/src/Accessor/Meta.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace PHPModelGenerator\Accessor;
6

7
/**
8
 * Provides access to the raw model input without exposing it as a public method on the model class.
9
 */
10
class Meta
11
{
NEW
12
    public function __construct(private readonly \Closure $rawInputGetter) {}
×
13

NEW
14
    public function rawInput(): array
×
15
    {
NEW
16
        return ($this->rawInputGetter)();
×
17
    }
18
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc