Skip to content

Commit

Permalink
fix: ProxyPostInterceptor methods return types must be compatible wit…
Browse files Browse the repository at this point in the history
…h parent
  • Loading branch information
lukmzig committed Oct 20, 2023
1 parent a25dc9c commit 48c5fd3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Proxy/Events/ProxyPostInterceptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
/**
* @internal
*/
final class ProxyPostInterceptor extends GenericEvent implements ProxyPostInterceptorInterface
class ProxyPostInterceptor extends GenericEvent implements ProxyPostInterceptorInterface
{
use GetMethodBasics;

public function setArgument(string $key, mixed $value): void
public function setArgument(string $key, mixed $value): static
{
throw new ReadOnlyException('Cannot modify event arguments after dispatch.');
}

public function setArguments(array $args = []): void
public function setArguments(array $args = []): static
{
throw new ReadOnlyException('Cannot modify event arguments after dispatch.');
}

public function getSubject(): void
public function getSubject(): mixed
{
throw new ReadOnlyException('Cannot modify or get event subject after dispatch.');
}
Expand Down
6 changes: 3 additions & 3 deletions src/Proxy/Events/ProxyPostInterceptorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ interface ProxyPostInterceptorInterface
/**
* @throws ReadOnlyException
*/
public function setArgument(string $key, mixed $value): void;
public function setArgument(string $key, mixed $value): static;

/**
* @throws ReadOnlyException
*/
public function setArguments(array $args = []): void;
public function setArguments(array $args = []): static;

/**
* @throws ReadOnlyException
*/
public function getSubject(): void;
public function getSubject(): mixed;

public function getSubjectClass(): string;

Expand Down

0 comments on commit 48c5fd3

Please sign in to comment.