mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-06 05:38:10 +08:00
Update AbstractAnnotation.php
Fixed value is not array, but not null.
This commit is contained in:
parent
c62a0a006b
commit
2b4e52fafb
@ -20,9 +20,11 @@ abstract class AbstractAnnotation implements AnnotationInterface, Arrayable
|
||||
{
|
||||
public function __construct($value = null)
|
||||
{
|
||||
foreach ($value ?? [] as $key => $val) {
|
||||
if (property_exists($this, $key)) {
|
||||
$this->{$key} = $val;
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $key => $val) {
|
||||
if (property_exists($this, $key)) {
|
||||
$this->{$key} = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user