Skip to content

Rename Property/PropertyConfig `name` field to `key`

Pre-release
Pre-release

Choose a tag to compare

@kassko kassko released this 03 Jan 21:30
· 13 commits to 2.0 since this release
b8c1557

Summary: Rename Property/PropertyConfig name field to key

Date: 2026-01-03
Branch: improv/dev/propertyFieldNameRenamingToKey

Overview

Renamed the name field to key in Property and PropertyConfig attributes for better semantic clarity. The field represents the raw data key, not the property name.

Changes Made

1. Attribute Classes

File Change
src/Attribute/Property.php $name → $key
src/Attribute/PropertyConfig.php $name → $key

2. Loader Updates

File Methods Updated
src/Loader/Loader.php getPropertyNameMapping(), mergePropertyConfig()

3. Test Files

Updated 14 test files to use Property(key: instead of Property(name::

  • Unit test fixtures (4 files)
  • Integration test fixtures (10 files)

4. Documentation

Updated 9 documentation files:

  • docs/attributes/Property.md - Parameter table and examples
  • docs/attributes/PropertyConfig.md - Parameter table
  • docs/attributes/MultiPropDataSource.md
  • docs/attributes/SkipAllProperties.md
  • docs/classes/Hydrator.md
  • docs/concepts/AttributeCascading.md
  • docs/concepts/ExpressionLanguage.md
  • EXAMPLE.md
  • README.md

Note: Historical documentation in docs/history/ was preserved unchanged.

Test Results

PHPUnit 11.5.46

Time: 00:00.927

Tests: 344, Assertions: 811, Skipped: 3
OK

Breaking Change

This is a breaking change. Users must update their code:

// Before
#[Property(name: 'first_name')]

// After  
#[Property(key: 'first_name')]