SchulIT /
idp
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace App\EventSubscriber; |
||||
| 4 | |||||
| 5 | use Symfony\Component\Console\ConsoleEvents; |
||||
| 6 | use Symfony\Component\Console\Event\ConsoleCommandEvent; |
||||
| 7 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
||||
| 8 | use Symfony\Component\HttpKernel\Event\RequestEvent; |
||||
| 9 | use Symfony\Component\HttpKernel\KernelEvents; |
||||
| 10 | |||||
| 11 | class SetPhpBinarySubscriber implements EventSubscriberInterface { |
||||
| 12 | |||||
| 13 | private function setPhpBinary(): void { |
||||
| 14 | if(!isset($_ENV['PHP_BINARY'])) { |
||||
| 15 | return; |
||||
| 16 | } |
||||
| 17 | |||||
| 18 | $binary = $_ENV['PHP_BINARY']; |
||||
| 19 | |||||
| 20 | if($binary !== false) { |
||||
| 21 | putenv('PHP_BINARY=' . $binary); |
||||
| 22 | } |
||||
| 23 | } |
||||
| 24 | |||||
| 25 | public function onCommand(ConsoleCommandEvent $commandEvent): void { |
||||
|
0 ignored issues
–
show
|
|||||
| 26 | $this->setPhpBinary(); |
||||
| 27 | } |
||||
| 28 | |||||
| 29 | public function onKernelRequest(RequestEvent $requestEvent): void { |
||||
|
0 ignored issues
–
show
The parameter
$requestEvent 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
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...
|
|||||
| 30 | $this->setPhpBinary(); |
||||
| 31 | } |
||||
| 32 | |||||
| 33 | /** |
||||
| 34 | * @inheritDoc |
||||
| 35 | */ |
||||
| 36 | public static function getSubscribedEvents(): array { |
||||
| 37 | return [ |
||||
| 38 | KernelEvents::REQUEST => 'onKernelRequest', |
||||
| 39 | ConsoleEvents::COMMAND => 'onCommand' |
||||
| 40 | ]; |
||||
| 41 | } |
||||
| 42 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.