phpgt/propfunc
A small PHP library that uses magic __get/__set methods to expose getters and setters as normal properties via the MagicProp trait, enabling live and read-only computed properties for DOM-style implementations. Note: PHP 8.4 property hooks may soon make it obsolete.
phpgt/propfunc package provides utility functions for dynamic property access/mutation (e.g., getProp(), setProp()), which could simplify boilerplate in Laravel applications where dynamic object manipulation is required (e.g., legacy systems, API wrappers, or dynamic form handling). v2.0.0 does not change the core use case.Arr::get(), Arr::set(), or collect() methods, or libraries like spatie/array-to-object may offer broader functionality with more predictable release cadence.GT\PropFunc. The legacy Gt\PropFunc namespace remains autoloadable, which softens the migration — but all new code and documentation should target GT\PropFunc.__prop_get_name / __prop_set_name) to camelCase (__propGetName / __propSetName). Any consuming class that defines these hooks must be updated; the old hook names will silently stop firing, which is a subtle runtime regression risk rather than a hard error.SECURITY.md was added, establishing a disclosure channel and CVE-handling expectation.setProp($obj, 'user.address.city')).Arr::* or collect() fall short?__prop_get_* / __prop_set_* hooks that need camelCase renaming?Gt\PropFunc namespace? If so, migration is mandatory, not optional.spatie/array-to-object, or a custom trait been re-evaluated given the breaking-change cost of upgrading?use GT\PropFunc\...).GT\PropFunc for all new code. Legacy Gt\PropFunc remains autoloadable for backwards compatibility but should be treated as deprecated for internal usage.Gt\PropFunc namespace or defining __prop_get_* / __prop_set_* hooks.Gt\PropFunc → GT\PropFunc.__prop_get_<name> → __propGet<Name>; __prop_set_<name> → __propSet<Name>.Arr::* methods for performance/correctness.app(PropFuncFacade::class)).^2.0.0 with a documented upgrade policy for future majors.spatie/array-to-object or a custom trait if the package's scope of dynamic access proves redundant.phpgt/* siblings for namespace consistency.| Phase | Task | Owner |
|---|---|---|
| Inventory | Grep codebase for Gt\PropFunc and __prop_(get|set)_ hooks. |
Backend Dev |
| Runtime Check | Confirm PHP 8.1+ across local, CI, and production. | DevOps |
| Pilot Upgrade | Upgrade one module to v2.0.0; rename namespaces and hooks. | Backend Dev |
| Testing | Validate hook firing, edge cases (nested props, type safety, perf). | QA/Backend |
| Documentation | Update wiki: new namespace, camelCase convention, PHP 8.1 baseline. | Tech Writer |
| Decision | Approve rollout vs. swap to alternatives based on pilot ROI. | TPM/Architect |
composer require phpgt/propfunc:^2.0.0).composer why-not-update, Dependabot on our side) for upstream releases.SECURITY.md, Dependabot automation, and active commit activity all lower the prior abandonment risk.GT\PropFunc namespace only.tap() or debugbar to inspect dynamic objects.SECURITY.md in repo provides a formal vulnerability-reporting path — reference it in our own runbook.| Risk | Mitigation Strategy | Owner |
|---|---|---|
| Silent hook failures post-upgrade | Regression tests per renamed hook; codebase-wide grep. | Backend Dev |
| PHP 8.1 baseline blocks deployment | Confirm runtime readiness before scheduling upgrade. | DevOps |
| Namespace drift | Static analysis rule (PHPStan/Rector) to enforce GT\ namespace. |
Backend Dev |
| Package Abandonment | Fork and maintain privately; monitor activity. | Backend Dev |
| Runtime Errors | Add input validation (e.g., is_object($obj)). |
Backend Dev |
| Security Vulnerabilities | Pin exact version; use SECURITY.md disclosure channel. |
Security Team |
| Laravel Version Incompatibility | Test on all supported Laravel versions. | QA |
| Over-Engineering | Sunset if native solutions suffice. | TPM |
__propGetName / __propSetName).Gt\ prefix.GT\PropFunc namespace.Arr::* methods.How can I help you explore Laravel packages today?