Skip to content

Commit

Permalink
minor #1057 [LiveComponent] Add missing typehints to HydrationExtensi…
Browse files Browse the repository at this point in the history
…onInterface (norkunas)

This PR was merged into the 2.x branch.

Discussion
----------

[LiveComponent] Add missing typehints to HydrationExtensionInterface

| Q             | A
| ------------- | ---
| Bug fix?      | no /not sure
| New feature?  | no /not sure
| Tickets       | N/A
| License       | MIT

I have a custom hydration extension that in `supports` method checks if the provided class has my custom marker attribute through Reflection, but SA complains:

> Parameter `#1` $objectOrClass of class ReflectionClass constructor expects class-string<T of object>|T of object, string given.

Commits
-------

7f8279c [LiveComponent] Add missing typehints to HydrationExtensionInterface
  • Loading branch information
weaverryan committed Aug 23, 2023
2 parents ec186f9 + 7f8279c commit 5fd8da1
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@

interface HydrationExtensionInterface
{
/**
* @param class-string $className
*/
public function supports(string $className): bool;

/**
* @param class-string $className
*/
public function hydrate(mixed $value, string $className): ?object;

/**
Expand Down

0 comments on commit 5fd8da1

Please sign in to comment.