Completed
Push — master ( 0cd2cd...e2ec22 )
by Sam
02:48
created

ServerTerminator::onException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of PHP DNS Server.
4
 *
5
 * (c) Yif Swery <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace yswery\DNS\Event\Subscriber;
12
13
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
14
use yswery\DNS\Event\Events;
15
use yswery\DNS\Event\ServerExceptionEvent;
16
17
class ServerTerminator implements EventSubscriberInterface
18
{
19
    public static function getSubscribedEvents(): array
20
    {
21
        return [
22
            Events::SERVER_START_FAIL => 'onException'
23
        ];
24
    }
25
26
    public function onException(ServerExceptionEvent $event): void
0 ignored issues
show
Unused Code introduced by
The parameter $event is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    public function onException(/** @scrutinizer ignore-unused */ ServerExceptionEvent $event): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
    {
28
        exit(1);
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
29
    }
30
}
31