Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rekalogika/direct-property-access
Simple implementation of PropertyAccessor that reads and writes directly to the object's properties, bypassing getters and setters.
https://github.com/rekalogika/direct-property-access
php properties property-accessor symfony symfony-bundle
Last synced: about 1 month ago
JSON representation
Simple implementation of PropertyAccessor that reads and writes directly to the object's properties, bypassing getters and setters.
- Host: GitHub
- URL: https://github.com/rekalogika/direct-property-access
- Owner: rekalogika
- License: mit
- Created: 2023-09-02T16:04:26.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-16T14:21:36.000Z (2 months ago)
- Last Synced: 2024-09-30T16:21:16.465Z (about 2 months ago)
- Topics: php, properties, property-accessor, symfony, symfony-bundle
- Language: PHP
- Homepage: https://rekalogika.dev/direct-property-access
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# rekalogika/direct-property-access
Implementation of Symfony's `PropertyAccessorInterface` that reads and writes
directly to the object's properties, bypassing getters and setters.## Synopsis
```php
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](https://rekalogika.dev/direct-property-access)
## Credits
This project took inspiration from the following projects.
* [Symfony Property Access](https://github.com/symfony/property-access)
* [kwn/reflection-property-access](https://github.com/kwn/reflection-property-access)
* [nelmio/alice](https://github.com/nelmio/alice/blob/master/src/PropertyAccess/ReflectionPropertyAccessor.php)## License
MIT
## Contributing
Issues and pull requests should be filed in the GitHub repository
[rekalogika/direct-property-access](https://github.com/rekalogika/direct-property-access).