rekalogika/direct-property-access

Simple implementation of PropertyAccessorInterface that reads and writes directly to the object's properties, bypassing getters and setters.

Fund package maintenance!
priyadi

Installs: 907

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:symfony-bundle

1.2.0 2024-01-15 14:12 UTC

This package is auto-updated.

Last update: 2024-04-15 14:43:36 UTC


README

Implementation of Symfony's PropertyAccessorInterface that reads and writes directly to the object's properties, bypassing getters and setters.

Synopsis

use Rekalogika\DirectPropertyAccess\DirectPropertyAccessor;

class Person
{
    private string $name = 'Jane';
}

$propertyAccessor = new DirectPropertyAccessor();

$name = $propertyAccessor->getValue($person, 'name'); // Jane
$propertyAccessor->setValue($person, 'name', 'John');

Documentation

rekalogika.dev/direct-property-access

Credits

This project took inspiration from the following projects.

License

MIT

Contributing

Issues and pull requests should be filed in the GitHub repository rekalogika/direct-property-access.