2019-10-24 16:57:27 -04:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
|
2019-11-08 16:27:08 -05:00
|
|
|
namespace Aviat\Kilo;
|
2019-10-24 16:57:27 -04:00
|
|
|
|
|
|
|
trait MagicProperties {
|
|
|
|
abstract public function __get(string $name);
|
|
|
|
|
|
|
|
public function __set(string $name, $value)
|
|
|
|
{
|
|
|
|
if (property_exists($this, $name))
|
|
|
|
{
|
|
|
|
$this->$name = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function __isset(string $name): bool
|
|
|
|
{
|
|
|
|
return isset($this->$name);
|
|
|
|
}
|
|
|
|
}
|