This commit is contained in:
2021-09-24 17:27:25 +08:00
parent dbc30827f8
commit 8a0858fbd7
72 changed files with 1 additions and 1 deletions
+55
View File
@@ -0,0 +1,55 @@
<?php
/**
* Created by PhpStorm.
* User: whwyy
* Date: 2018/3/30 0030
* Time: 14:28
*/
declare(strict_types=1);
namespace Kiri\Abstracts;
use Exception;
use JetBrains\PhpStorm\Pure;
use Kiri\Exception\ComponentException;
use Kiri\Kiri;
/**
* Class Component
* @package Kiri\Kiri\Base
*/
class Component extends BaseObject
{
/**
* @param $name
* @param $value
* @throws Exception
*/
public function __set($name, $value)
{
if (property_exists($this, $name)) {
$this->$name = $value;
} else {
parent::__set($name, $value);
}
}
/**
* @param $name
* @return mixed
* @throws Exception
*/
public function __get($name): mixed
{
if (property_exists($this, $name)) {
return $this->$name ?? null;
} else {
return parent::__get($name);
}
}
}