Skip to content

Commit

Permalink
chore: avoid deprecations in PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
brotkrueml committed Nov 14, 2024
1 parent 38b9411 commit b28190a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Classes/EventListener/TrackErrorPages.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class TrackErrorPages
/**
* Arguments for testing purposes!
*/
public function __construct(ServerRequestInterface $request = null)
public function __construct(?ServerRequestInterface $request = null)
{
$this->request = $request ?? $GLOBALS['TYPO3_REQUEST'];
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Code/JavaScriptTrackingCodeBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function getTrackingCodeWithMinimumConfigurationAndNoEventListenersReturn
]);

$eventDispatcher = new class() implements EventDispatcherInterface {
public function dispatch(object $event, string $eventName = null): object
public function dispatch(object $event, ?string $eventName = null): object
{
return $event;
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Code/TagManagerCodeBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class TagManagerCodeBuilderTest extends TestCase
protected function setUp(): void
{
$eventDispatcher = new class() implements EventDispatcherInterface {
public function dispatch(object $event, string $eventName = null): object
public function dispatch(object $event, ?string $eventName = null): object
{
return $event;
}
Expand Down Expand Up @@ -82,7 +82,7 @@ public function getCodeReturnsTagManagerCodeWithEnabledDebugModeCorrectly(): voi
public function getCodeReturnsTagManagerCodeWithDispatchedAddToDataLayerEventCorrectly(): void
{
$eventDispatcher = new class() implements EventDispatcherInterface {
public function dispatch(object $event, string $eventName = null): object
public function dispatch(object $event, ?string $eventName = null): object
{
$event->addVariable('someName', 'someValue');

Expand Down

0 comments on commit b28190a

Please sign in to comment.