for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of PHP DNS Server.
*
* (c) Yif Swery <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace yswery\DNS\Event\Subscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use yswery\DNS\Event\Events;
use yswery\DNS\Event\ServerExceptionEvent;
class ServerTerminator implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
return [
Events::SERVER_START_FAIL => 'onException'
];
}
public function onException(ServerExceptionEvent $event): void
$event
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
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.
exit(1);
exit
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.