Update to laravel 7

This commit is contained in:
KodeStar
2022-03-10 11:54:29 +00:00
parent 61a5a1a8b0
commit f9a19fce91
7170 changed files with 274189 additions and 283773 deletions

View File

@@ -16,12 +16,12 @@ namespace Symfony\Component\Console\Event;
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class ConsoleCommandEvent extends ConsoleEvent
final class ConsoleCommandEvent extends ConsoleEvent
{
/**
* The return code for skipped commands, this will also be passed into the terminate event.
*/
const RETURN_CODE_DISABLED = 113;
public const RETURN_CODE_DISABLED = 113;
/**
* Indicates if the command should be run or skipped.
@@ -30,30 +30,21 @@ class ConsoleCommandEvent extends ConsoleEvent
/**
* Disables the command, so it won't be run.
*
* @return bool
*/
public function disableCommand()
public function disableCommand(): bool
{
return $this->commandShouldRun = false;
}
/**
* Enables the command.
*
* @return bool
*/
public function enableCommand()
public function enableCommand(): bool
{
return $this->commandShouldRun = true;
}
/**
* Returns true if the command is runnable, false otherwise.
*
* @return bool
*/
public function commandShouldRun()
public function commandShouldRun(): bool
{
return $this->commandShouldRun;
}

View File

@@ -53,6 +53,6 @@ final class ConsoleErrorEvent extends ConsoleEvent
public function getExitCode(): int
{
return null !== $this->exitCode ? $this->exitCode : (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1);
return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1);
}
}

View File

@@ -14,7 +14,7 @@ namespace Symfony\Component\Console\Event;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;
/**
* Allows to inspect input and output of a command.
@@ -28,7 +28,7 @@ class ConsoleEvent extends Event
private $input;
private $output;
public function __construct(Command $command = null, InputInterface $input, OutputInterface $output)
public function __construct(?Command $command, InputInterface $input, OutputInterface $output)
{
$this->command = $command;
$this->input = $input;
@@ -38,7 +38,7 @@ class ConsoleEvent extends Event
/**
* Gets the command that is executed.
*
* @return Command|null A Command instance
* @return Command|null
*/
public function getCommand()
{
@@ -48,7 +48,7 @@ class ConsoleEvent extends Event
/**
* Gets the input instance.
*
* @return InputInterface An InputInterface instance
* @return InputInterface
*/
public function getInput()
{
@@ -58,7 +58,7 @@ class ConsoleEvent extends Event
/**
* Gets the output instance.
*
* @return OutputInterface An OutputInterface instance
* @return OutputInterface
*/
public function getOutput()
{

View File

@@ -0,0 +1,35 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Event;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @author marie <marie@users.noreply.github.com>
*/
final class ConsoleSignalEvent extends ConsoleEvent
{
private $handlingSignal;
public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal)
{
parent::__construct($command, $input, $output);
$this->handlingSignal = $handlingSignal;
}
public function getHandlingSignal(): int
{
return $this->handlingSignal;
}
}

View File

@@ -20,7 +20,7 @@ use Symfony\Component\Console\Output\OutputInterface;
*
* @author Francesco Levorato <git@flevour.net>
*/
class ConsoleTerminateEvent extends ConsoleEvent
final class ConsoleTerminateEvent extends ConsoleEvent
{
private $exitCode;
@@ -31,22 +31,12 @@ class ConsoleTerminateEvent extends ConsoleEvent
$this->setExitCode($exitCode);
}
/**
* Sets the exit code.
*
* @param int $exitCode The command exit code
*/
public function setExitCode($exitCode)
public function setExitCode(int $exitCode): void
{
$this->exitCode = (int) $exitCode;
$this->exitCode = $exitCode;
}
/**
* Gets the exit code.
*
* @return int The command exit code
*/
public function getExitCode()
public function getExitCode(): int
{
return $this->exitCode;
}