php-kilo/src/Traits/MagicProperties.php
Timothy Warren b642ff5c59
All checks were successful
timw4mail/php-kilo/pipeline/head This commit looks good
Readability refactoring
2021-03-04 12:03:51 -05:00

20 lines
351 B
PHP

<?php declare(strict_types=1);
namespace Aviat\Kilo\Traits;
trait MagicProperties {
abstract public function __get(string $name);
public function __set(string $name, mixed $value): void
{
if (property_exists($this, $name))
{
$this->$name = $value;
}
}
public function __isset(string $name): bool
{
return isset($this->$name);
}
}