Skip to content

Commit 24fa1be

Browse files
committed
minor #861 [LiveComponent] Added type mixed to $value property and added string $className to mach HydrationExtensionInterface (mwansinck)
This PR was merged into the 2.x branch. Discussion ---------- [LiveComponent] Added type mixed to $value property and added string $className to mach HydrationExtensionInterface | Q | A | ------------- | --- | Bug fix? | no | New feature? |no | License | MIT Documentation example for writing the hydrate method was not compatible with the HydrationExtensionInterface. Corrected the example so the code can be copy-pasted without errors. Commits ------- 4b29a1f Added type mixed to $value property and added string $className to match HydrationExtensionInterface
2 parents 8700c90 + 4b29a1f commit 24fa1be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/LiveComponent/doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ a custom ``Food`` object, a hydration extension might look like this::
700700
return is_subclass_of($className, Food::class);
701701
}
702702

703-
public function hydrate($value)
703+
public function hydrate(mixed $value, string $className): ?object
704704
{
705705
return new Food($value['name'], $value['isCooked']);
706706
}

0 commit comments

Comments
 (0)