Skip to content

Commit

Permalink
Merge pull request #30 from creative-commoners/pulls/2/php84
Browse files Browse the repository at this point in the history
API Explicity mark nullable parameters for PHP 8.4
  • Loading branch information
GuySartorelli authored Dec 2, 2024
2 parents 4ef00cf + 7cc6c66 commit 990527a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Dispatch/EventDispatcherInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ public function removeListener(string $eventName, EventHandlerInterface $listene
* @param object $eventContext
* @param string|null $eventName
*/
public function dispatch(object $eventContext, string $eventName = null): void;
public function dispatch(object $eventContext, ?string $eventName = null): void;
}
2 changes: 1 addition & 1 deletion src/Symfony/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Event implements EventContextInterface
* @param string $action
* @param array $properties
*/
public function __construct(string $action = null, array $properties = [])
public function __construct(?string $action = null, array $properties = [])
{
$this->event = new GenericEvent($action, $properties);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Dispatch/MockBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MockBackend implements EventDispatcherInterface

public $listeners = [];

public function dispatch(object $eventContext, string $eventName = null): void
public function dispatch(object $eventContext, ?string $eventName = null): void
{
$listeners = $this->listeners[$eventName] ?? [];
foreach ($listeners as $listener) {
Expand Down

0 comments on commit 990527a

Please sign in to comment.