Skip to content

Commit f24d432

Browse files
nicolas-grekasfabpot
authored andcommitted
Bump minimum version of PHP to 8.1
1 parent 15295dd commit f24d432

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Debug/TraceableEventDispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function getNotCalledListeners(Request $request = null): array
222222
}
223223
}
224224

225-
uasort($notCalled, [$this, 'sortNotCalledListeners']);
225+
uasort($notCalled, $this->sortNotCalledListeners(...));
226226

227227
return $notCalled;
228228
}

Debug/WrappedListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class WrappedListener
3737
public function __construct(callable|array $listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null, int $priority = null)
3838
{
3939
$this->listener = $listener;
40-
$this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? \Closure::fromCallable($listener) : null);
40+
$this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? $listener(...) : null);
4141
$this->stopwatch = $stopwatch;
4242
$this->dispatcher = $dispatcher;
4343
$this->priority = $priority;

EventDispatcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@ private function optimizeListeners(string $eventName): array
267267
$listener[0] = $listener[0]();
268268
$listener[1] ??= '__invoke';
269269
}
270-
($closure = \Closure::fromCallable($listener))(...$args);
270+
($closure = $listener(...))(...$args);
271271
};
272272
} else {
273-
$closure = $listener instanceof \Closure || $listener instanceof WrappedListener ? $listener : \Closure::fromCallable($listener);
273+
$closure = $listener instanceof WrappedListener ? $listener : $listener(...);
274274
}
275275
}
276276
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=8.0.2",
19+
"php": ">=8.1",
2020
"symfony/event-dispatcher-contracts": "^2|^3"
2121
},
2222
"require-dev": {

0 commit comments

Comments
 (0)