Remove `get`, `has`, `let` and `set` Method(s) from Non-Static Class(es)
taufik-nurrohman opened this issue · comments
Use the built-in __get
, __isset
, __set
and __unset
method overloading instead.
Before
if (!$page->has('foo')) {
$page->set('foo', ['bar' => 1]);
}
echo $page->get('foo.bar');
echo $page->get('foo-bar');
After
if (!isset($page->foo)) {
$page->foo = ['bar' => 1];
}
echo $page->foo->bar ?? null;
echo $page->fooBar;