Skip to content

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

License

Notifications You must be signed in to change notification settings

rekalogika/direct-property-access

Repository files navigation

rekalogika/direct-property-access

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published