rekalogika / direct-property-access
直接读取和写入对象属性的简单实现,绕过getter和setter。
1.3.0
2024-09-16 14:20 UTC
Requires
- symfony/property-access: ^6.1 || ^7.0
Requires (Dev)
- phpstan/phpstan: ^1.12
- phpunit/phpunit: ^10.5
- psalm/plugin-phpunit: ^0.19.0
- symfony/config: ^6.1 || ^7.0
- symfony/dependency-injection: ^6.1 || ^7.0
- symfony/http-kernel: ^6.1 || ^7.0
- symfony/phpunit-bridge: ^6.1 || ^7.0
- vimeo/psalm: ^5.26
- 1.3.0
- dev-main / 1.2.x-dev
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- dev-dependabot/github_actions/ramsey/composer-install-3
- dev-feat/php-8.4
- dev-dependabot/composer/psalm/plugin-phpunit-tw-0.19.0
- dev-dependabot/github_actions/actions/cache-4
- dev-dependabot/github_actions/actions/checkout-4
- dev-build/dependabot
- dev-chore/static-analysis
- dev-test
This package is auto-updated.
Last update: 2024-09-16 14:21:39 UTC
README
实现Symfony的PropertyAccessorInterface
,直接读取和写入对象的属性,绕过getter和setter。
概要
use Rekalogika\DirectPropertyAccess\DirectPropertyAccessor; class Person { private string $name = 'Jane'; } $propertyAccessor = new DirectPropertyAccessor(); $name = $propertyAccessor->getValue($person, 'name'); // Jane $propertyAccessor->setValue($person, 'name', 'John');
文档
rekalogika.dev/direct-property-access
致谢
本项目受到了以下项目的启发。
许可协议
MIT
贡献
问题和拉取请求应提交到GitHub仓库 rekalogika/direct-property-access。