for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\EventSubscriber;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
class SetPhpBinarySubscriber implements EventSubscriberInterface {
private function setPhpBinary(): void {
$binary = $_ENV['PHP_BINARY'];
if($binary !== null && $binary !== false) {
putenv('PHP_BINARY=' . $binary);
}
public function onCommand(ConsoleCommandEvent $commandEvent): void {
$commandEvent
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function onCommand(/** @scrutinizer ignore-unused */ ConsoleCommandEvent $commandEvent): void {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$this->setPhpBinary();
public function onKernelRequest(RequestEvent $requestEvent): void {
$requestEvent
public function onKernelRequest(/** @scrutinizer ignore-unused */ RequestEvent $requestEvent): void {
/**
* @inheritDoc
*/
public static function getSubscribedEvents() {
return [
KernelEvents::REQUEST => 'onKernelRequest',
ConsoleEvents::COMMAND => 'onCommand'
];
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.