Skip to content

Commit c47f64a

Browse files
Bug: Clear outside of the foreach loop
1 parent 4ea1896 commit c47f64a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/AutoBind.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ public static function bind($class): void
3030
$reflection = new \ReflectionClass($class);
3131
$properties = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC);
3232

33+
// Clear the matched properties for the given class before adding new ones
34+
self::$matchedProperties[get_class($class)] = [];
35+
3336
foreach ($properties as $property) {
3437
$name = $property->getName();
3538
$type = $property->getType()?->getName() ?? null;
3639

37-
// Clear the matched properties for the given class before adding new ones
38-
self::$matchedProperties[get_class($class)] = [];
39-
4040
// Check if the property has the AutoBindProperty attribute
4141
$bindData = $property->getAttributes(AutoBindProperty::class);
4242

0 commit comments

Comments
 (0)