Skip to content

Commit

Permalink
TReflectionProperties: Fix accessing uninitialized properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Rixafy authored and f3l1x committed Feb 20, 2023
1 parent 8ae43ce commit 95f539e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Core/Mapping/TReflectionProperties.php
Expand Up @@ -7,11 +7,11 @@
trait TReflectionProperties
{

/** @var mixed[] */
/** @var array<string, array<string, mixed>> */
protected array $properties = [];

/**
* @return mixed[]
* @return array<string, array<string, mixed>>
*/
public function getProperties(): array
{
Expand All @@ -35,7 +35,7 @@ public function getProperties(): array
$name = $property->getName();
$properties[$name] = [
'name' => $name,
'type' => $property->getValue($this),
'type' => $property->isInitialized($this) ? $property->getValue($this) : null,
'defaultValue' => $defaultProperties[$name] ?? null,
];
}
Expand All @@ -47,7 +47,7 @@ public function getProperties(): array
}

/**
* @return mixed[]
* @return array<string, mixed>
*/
public function toArray(): array
{
Expand Down

0 comments on commit 95f539e

Please sign in to comment.