(Grav GitSync) Automatic Commit from smokephil

This commit is contained in:
smokephil 2024-04-30 21:27:37 +02:00 committed by GitSync
parent ab8f386766
commit 54730a9480
251 changed files with 5008 additions and 8945 deletions

View file

@ -42,7 +42,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
private $requestStack;
private $currentRequestHash = '';
public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null, RequestStack $requestStack = null)
public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, ?LoggerInterface $logger = null, ?RequestStack $requestStack = null)
{
$this->dispatcher = $dispatcher;
$this->stopwatch = $stopwatch;
@ -97,7 +97,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
/**
* {@inheritdoc}
*/
public function getListeners(string $eventName = null)
public function getListeners(?string $eventName = null)
{
return $this->dispatcher->getListeners($eventName);
}
@ -123,7 +123,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
/**
* {@inheritdoc}
*/
public function hasListeners(string $eventName = null)
public function hasListeners(?string $eventName = null)
{
return $this->dispatcher->hasListeners($eventName);
}
@ -131,7 +131,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
/**
* {@inheritdoc}
*/
public function dispatch(object $event, string $eventName = null): object
public function dispatch(object $event, ?string $eventName = null): object
{
$eventName = $eventName ?? \get_class($event);
@ -171,7 +171,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
/**
* @return array
*/
public function getCalledListeners(Request $request = null)
public function getCalledListeners(?Request $request = null)
{
if (null === $this->callStack) {
return [];
@ -192,7 +192,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
/**
* @return array
*/
public function getNotCalledListeners(Request $request = null)
public function getNotCalledListeners(?Request $request = null)
{
try {
$allListeners = $this->getListeners();
@ -235,7 +235,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
return $notCalled;
}
public function getOrphanedEvents(Request $request = null): array
public function getOrphanedEvents(?Request $request = null): array
{
if ($request) {
return $this->orphanedEvents[spl_object_hash($request)] ?? [];