Getter and setter method trait for PHP
Find a file
2023-02-19 13:36:21 -06:00
lib Changed namespace, updated composer 2023-02-19 13:17:19 -06:00
tests Updated tests 2023-02-19 13:36:21 -06:00
.gitignore Initial commit 2023-01-26 18:57:09 -06:00
AUTHORS Initial commit 2023-01-26 18:57:09 -06:00
composer.json Changed namespace, updated composer 2023-02-19 13:17:19 -06:00
composer.lock Changed namespace, updated composer 2023-02-19 13:17:19 -06:00
LICENSE Initial commit 2023-01-26 18:57:09 -06:00
README.md Initial commit 2023-01-26 18:57:09 -06:00
run Changed namespace, updated composer 2023-02-19 13:17:19 -06:00

Getters & Setters

Let's face it. Getters and setters in PHP sucks. Instead of having getter and setter accessor methods for classes we instead have the __get and __set magic methods to handle all properties. Not only are they unwieldy to use when you have many properties they also become difficult to handle when inheriting, especially when traits are involved. This trait attempts to create hackish getter and setter methods that can be extended by simple inheritance.

This trait was originally called MagicProperties and was available in the mensbeam/framework package. That one has been discontinued.

This is a stub. Documentation is forthcoming.