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

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

08 Apr 2026 11:09AM UTC coverage: 23.276% (+3.2%) from 20.075%
24132333514

push

github

wol-soft
Serialize using JSON Schema property names; introduce #[Internal] attribute

SerializableTrait:
- Use #[SchemaName] reflection to map PHP property names to original JSON
  Schema names so all serialization output keys match the schema definition
- $except now takes schema names only (breaking change; was PHP attribute names)
- skipNotProvidedPropertiesMap / rawModelDataInput references updated to match
  new generated property names (no leading underscore)
- Fallback path for hand-written classes: removed str_starts_with('_') exclusion;
  #[Internal] is now the sole mechanism for marking properties as non-serializable
- getCustomSerializerMethod cache is now per-class (static::class::property key)
  using array_key_exists, fixing incorrect cache hits when base and subclass
  share a property name but the subclass adds a custom serializer method
- evaluateAttribute: cache serialization capability per class; propagate depth
  budget correctly; handle depth-exhausted after cache population

Internal attribute (new):
- PHPModelGenerator\Attributes\Internal marks a property as excluded from
  serialization; replaces the implicit underscore naming convention
- Static trait properties ($propertySchemaNames, $objectSerializationCapability,
  $customSerializer) are annotated with #[Internal]

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

46 of 71 new or added lines in 2 files covered. (64.79%)

1 existing line in 1 file now uncovered.

135 of 580 relevant lines covered (23.28%)

0.58 hits per line

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

0.0
/src/Attributes/Internal.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace PHPModelGenerator\Attributes;
6

7
use Attribute;
8

9
/**
10
 * Marks a property as internal to the model infrastructure.
11
 * Properties with this attribute are excluded from serialization.
12
 */
13
#[Attribute(Attribute::TARGET_PROPERTY)]
14
readonly class Internal
15
{
NEW
16
    public function __construct()
×
NEW
17
    {}
×
18
}
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