Skip to content

Commit 4a9795f

Browse files
committed
CLEANUP: ExceptionListener. add return type etc
1 parent 4a8ff5b commit 4a9795f

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

EventListener/ExceptionListener.php

+6-26
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,14 @@
1313

1414
class ExceptionListener implements EventSubscriberInterface {
1515

16-
/**
17-
* @var ExceptionConverterServiceInterface
18-
*/
19-
private $exceptionConverterService;
20-
21-
/**
22-
* @var ExceptionLogServiceInterface
23-
*/
24-
private $logExceptionService;
25-
26-
/**
27-
* @var ExceptionResponseServiceInterface
28-
*/
29-
private $exceptionResponseService;
30-
3116
/**
3217
* ExceptionListener constructor.
33-
*
34-
* @param ExceptionConverterServiceInterface $exceptionConverterService
35-
* @param ExceptionLogServiceInterface $logExceptionService
36-
* @param ExceptionResponseServiceInterface $exceptionResponseService
3718
*/
38-
public function __construct(ExceptionConverterServiceInterface $exceptionConverterService,
39-
ExceptionLogServiceInterface $logExceptionService,
40-
ExceptionResponseServiceInterface $exceptionResponseService) {
41-
$this->exceptionConverterService = $exceptionConverterService;
42-
$this->logExceptionService = $logExceptionService;
43-
$this->exceptionResponseService = $exceptionResponseService;
19+
public function __construct(
20+
private readonly ExceptionConverterServiceInterface $exceptionConverterService,
21+
private readonly ExceptionLogServiceInterface $logExceptionService,
22+
private readonly ExceptionResponseServiceInterface $exceptionResponseService
23+
) {
4424
}
4525

4626
/**
@@ -82,7 +62,7 @@ public function onKernelException(ExceptionEvent $event) {
8262
/**
8363
* @inheritDoc
8464
*/
85-
public static function getSubscribedEvents() {
65+
public static function getSubscribedEvents(): array {
8666
return array(
8767
KernelEvents::EXCEPTION => [
8868
['convertKernelException', -1],

0 commit comments

Comments
 (0)