Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Symfony v7.0 support #48403

Merged
merged 26 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,30 @@
"doctrine/inflector": "^2.0.5",
"dragonmantank/cron-expression": "^3.3.2",
"egulias/email-validator": "^3.2.1|^4.0",
"fruitcake/php-cors": "^1.2",
"fruitcake/php-cors": "dev-symfony7",
"guzzlehttp/uri-template": "^1.0",
"laravel/prompts": "^0.1.9",
"laravel/prompts": "dev-symfony7",
"laravel/serializable-closure": "^1.3",
"league/commonmark": "^2.2.1",
"league/flysystem": "^3.8.0",
"monolog/monolog": "^3.0",
"nesbot/carbon": "^2.67",
"nunomaduro/termwind": "^1.13",
"nunomaduro/termwind": "dev-symfony7",
"psr/container": "^1.1.1|^2.0.1",
"psr/log": "^1.0|^2.0|^3.0",
"psr/simple-cache": "^1.0|^2.0|^3.0",
"ramsey/uuid": "^4.7",
"symfony/console": "^6.3",
"symfony/error-handler": "^6.3",
"symfony/finder": "^6.3",
"symfony/http-foundation": "^6.3",
"symfony/http-kernel": "^6.3",
"symfony/mailer": "^6.3",
"symfony/mime": "^6.3",
"symfony/process": "^6.3",
"symfony/routing": "^6.3",
"symfony/uid": "^6.3",
"symfony/var-dumper": "^6.3",
"symfony/console": "7.0.x-dev as 6.4.0",
"symfony/error-handler": "7.0.x-dev as 6.4.0",
"symfony/finder": "7.0.x-dev as 6.4.0",
"symfony/http-foundation": "7.0.x-dev as 6.4.0",
"symfony/http-kernel": "7.0.x-dev as 6.4.0",
"symfony/mailer": "7.0.x-dev as 6.4.0",
"symfony/mime": "7.0.x-dev as 6.4.0",
"symfony/process": "7.0.x-dev as 6.4.0",
"symfony/routing": "7.0.x-dev as 6.4.0",
"symfony/uid": "7.0.x-dev as 6.4.0",
"symfony/var-dumper": "7.0.x-dev as 6.4.0",
"tijsverkoyen/css-to-inline-styles": "^2.2.5",
"vlucas/phpdotenv": "^5.4.1",
"voku/portable-ascii": "^2.0"
Expand Down Expand Up @@ -109,8 +109,8 @@
"phpstan/phpstan": "^1.4.7",
"phpunit/phpunit": "^10.0.7",
"predis/predis": "^2.0.2",
"symfony/cache": "^6.3",
"symfony/http-client": "^6.3.4"
"symfony/cache": "7.0.x-dev as 6.4.0",
"symfony/http-client": "7.0.x-dev as 6.4.0"
},
"provide": {
"psr/container-implementation": "1.1|2.0",
Expand Down Expand Up @@ -191,6 +191,16 @@
"composer/package-versions-deprecated": true
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/laravel-labs/termwind"
},
{
"type": "vcs",
"url": "https://github.com/laravel-labs/php-cors"
}
],
"minimum-stability": "dev",
"prefer-stable": true
}
4 changes: 2 additions & 2 deletions src/Illuminate/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ public function output()
* Add a command to the console.
*
* @param \Symfony\Component\Console\Command\Command $command
* @return \Symfony\Component\Console\Command\Command
* @return \Symfony\Component\Console\Command\Command|null
*/
public function add(SymfonyCommand $command)
public function add(SymfonyCommand $command): ?SymfonyCommand
{
if ($command instanceof Command) {
$command->setLaravel($this->laravel);
Expand Down
4 changes: 1 addition & 3 deletions src/Illuminate/Console/BufferedConsoleOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ public function fetch()

/**
* {@inheritdoc}
*
* @return void
*/
protected function doWrite(string $message, bool $newline)
protected function doWrite(string $message, bool $newline): void
{
$this->buffer .= $message;

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function run(InputInterface $input, OutputInterface $output): int
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return int
crynobone marked this conversation as resolved.
Show resolved Hide resolved
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
if ($this instanceof Isolatable && $this->option('isolated') !== false &&
! $this->commandIsolationMutex()->create($this)) {
Expand Down
10 changes: 3 additions & 7 deletions src/Illuminate/Console/OutputStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function askQuestion(Question $question): mixed
/**
* {@inheritdoc}
*/
public function write(string|iterable $messages, bool $newline = false, int $options = 0)
public function write(string|iterable $messages, bool $newline = false, int $options = 0): void
{
$this->newLinesWritten = $this->trailingNewLineCount($messages) + (int) $newline;
$this->newLineWritten = $this->newLinesWritten > 0;
Expand All @@ -74,10 +74,8 @@ public function write(string|iterable $messages, bool $newline = false, int $opt

/**
* {@inheritdoc}
*
* @return void
*/
public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL)
public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL): void
{
$this->newLinesWritten = $this->trailingNewLineCount($messages) + 1;
$this->newLineWritten = true;
Expand All @@ -87,10 +85,8 @@ public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORM

/**
* {@inheritdoc}
*
* @return void
*/
public function newLine(int $count = 1)
public function newLine(int $count = 1): void
{
$this->newLinesWritten += $count;
$this->newLineWritten = $this->newLinesWritten > 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Console/QuestionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class QuestionHelper extends SymfonyQuestionHelper
*
* @return void
*/
protected function writePrompt(OutputInterface $output, Question $question)
protected function writePrompt(OutputInterface $output, Question $question): void
{
$text = OutputFormatter::escapeTrailingBackslash($question->getQuestion());

Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/ClosureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct($signature, Closure $callback)
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$inputs = array_merge($input->getArguments(), $input->getOptions());

Expand Down
15 changes: 11 additions & 4 deletions src/Illuminate/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ class Request extends SymfonyRequest implements Arrayable, ArrayAccess
Concerns\InteractsWithInput,
Macroable;

/**
* The Laravel session instance.
*
* @var
driesvints marked this conversation as resolved.
Show resolved Hide resolved
*/
protected $laravelSession;

/**
* The decoded JSON content for the request.
*
Expand Down Expand Up @@ -533,7 +540,7 @@ protected function filterFiles($files)
*/
public function hasSession(bool $skipIfUninitialized = false): bool
{
return ! is_null($this->session);
return ! is_null($this->laravelSession);
}

/**
Expand All @@ -542,7 +549,7 @@ public function hasSession(bool $skipIfUninitialized = false): bool
public function getSession(): SessionInterface
{
return $this->hasSession()
? new SymfonySessionDecorator($this->session())
? new SymfonySessionDecorator($this->laravelSession)
: throw new SessionNotFoundException;
}

Expand All @@ -559,7 +566,7 @@ public function session()
throw new RuntimeException('Session store not set on request.');
}

return $this->session;
return $this->laravelSession;
}

/**
Expand All @@ -570,7 +577,7 @@ public function session()
*/
public function setLaravelSession($session)
{
$this->session = $session;
$this->laravelSession = $session;
}

/**
Expand Down
28 changes: 7 additions & 21 deletions src/Illuminate/Session/SymfonySessionDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ public function getId(): string

/**
* {@inheritdoc}
*
* @return void
*/
public function setId(string $id)
public function setId(string $id): void
{
$this->store->setId($id);
}
Expand All @@ -64,10 +62,8 @@ public function getName(): string

/**
* {@inheritdoc}
*
* @return void
*/
public function setName(string $name)
public function setName(string $name): void
{
$this->store->setName($name);
}
Expand All @@ -94,10 +90,8 @@ public function migrate(bool $destroy = false, int $lifetime = null): bool

/**
* {@inheritdoc}
*
* @return void
*/
public function save()
public function save(): void
{
$this->store->save();
}
Expand All @@ -120,10 +114,8 @@ public function get(string $name, mixed $default = null): mixed

/**
* {@inheritdoc}
*
* @return void
*/
public function set(string $name, mixed $value)
public function set(string $name, mixed $value): void
{
$this->store->put($name, $value);
}
Expand All @@ -138,10 +130,8 @@ public function all(): array

/**
* {@inheritdoc}
*
* @return void
*/
public function replace(array $attributes)
public function replace(array $attributes): void
{
$this->store->replace($attributes);
}
Expand All @@ -156,10 +146,8 @@ public function remove(string $name): mixed

/**
* {@inheritdoc}
*
* @return void
*/
public function clear()
public function clear(): void
{
$this->store->flush();
}
Expand All @@ -174,10 +162,8 @@ public function isStarted(): bool

/**
* {@inheritdoc}
*
* @return void
*/
public function registerBag(SessionBagInterface $bag)
public function registerBag(SessionBagInterface $bag): void
{
throw new BadMethodCallException('Method not implemented by Laravel.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Testing/ParallelConsoleOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct($output)
* @param int $options
* @return void
*/
public function write($messages, bool $newline = false, int $options = 0)
public function write($messages, bool $newline = false, int $options = 0): void
{
$messages = collect($messages)->filter(function ($message) {
return ! Str::contains($message, $this->ignore);
Expand Down
Loading