This commit is contained in:
2023-08-25 00:18:44 +08:00
parent 5b0e69f190
commit d37f43c4ac
+6 -8
View File
@@ -372,12 +372,11 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
} }
/** /**
* @param $name * @param string $name
* @param $value * @param mixed $value
* @return mixed * @return mixed
* @throws ReflectionException
*/ */
public function setAttribute($name, $value): mixed public function setAttribute(string $name, mixed $value): mixed
{ {
$method = 'set' . ucfirst($name) . 'Attribute'; $method = 'set' . ucfirst($name) . 'Attribute';
if (method_exists($this, $method)) { if (method_exists($this, $method)) {
@@ -387,12 +386,11 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
} }
/** /**
* @param $name * @param string $name
* @param $value * @param mixed $value
* @return mixed * @return mixed
* @throws ReflectionException
*/ */
public function setOldAttribute($name, $value): mixed public function setOldAttribute(string $name, mixed $value): mixed
{ {
$method = 'set' . ucfirst($name) . 'Attribute'; $method = 'set' . ucfirst($name) . 'Attribute';
if (method_exists($this, $method)) { if (method_exists($this, $method)) {