Skip to content

Commit

Permalink
[11.x] Symfony v7.0 support (#48403)
Browse files Browse the repository at this point in the history
* Try Symfony v7

* wip

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* Update src/Illuminate/Http/Request.php

Co-authored-by: Julius Kiekbusch <contact@julius-kiekbusch.de>

* Update src/Illuminate/Console/Command.php

Co-authored-by: Ngô Quốc Đạt <datlechin@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* Apply fixes from StyleCI

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* Uses Termwind v2

* Update composer.json

* Update composer.json

* Update composer.json

* Update composer.json

---------

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Co-authored-by: Mior Muhammad Zaki <crynobone@gmail.com>
Co-authored-by: Julius Kiekbusch <contact@julius-kiekbusch.de>
Co-authored-by: Ngô Quốc Đạt <datlechin@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Nuno Maduro <enunomaduro@gmail.com>
  • Loading branch information
6 people authored Oct 12, 2023
1 parent 106c015 commit 838592e
Show file tree
Hide file tree
Showing 24 changed files with 69 additions and 90 deletions.
32 changes: 16 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": "^1.3",
"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": "^2.0",
"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",
"symfony/error-handler": "^7.0",
"symfony/finder": "^7.0",
"symfony/http-foundation": "^7.0",
"symfony/http-kernel": "^7.0",
"symfony/mailer": "^7.0",
"symfony/mime": "^7.0",
"symfony/process": "^7.0",
"symfony/routing": "^7.0",
"symfony/uid": "^7.0",
"symfony/var-dumper": "^7.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",
"symfony/http-client": "^7.0"
},
"provide": {
"psr/container-implementation": "1.1|2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"illuminate/database": "Required to use the database cache driver (^11.0).",
"illuminate/filesystem": "Required to use the file cache driver (^11.0).",
"illuminate/redis": "Required to use the redis cache driver (^11.0).",
"symfony/cache": "Required to use PSR-6 cache bridge (^6.3)."
"symfony/cache": "Required to use PSR-6 cache bridge (^7.0)."
},
"config": {
"sort-packages": true
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Collections/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
},
"suggest": {
"symfony/var-dumper": "Required to use the dump method (^6.3)."
"symfony/var-dumper": "Required to use the dump method (^7.0)."
},
"config": {
"sort-packages": true
Expand Down
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
3 changes: 1 addition & 2 deletions src/Illuminate/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,8 @@ public function run(InputInterface $input, OutputInterface $output): int
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return int
*/
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
4 changes: 2 additions & 2 deletions src/Illuminate/Console/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"illuminate/view": "^11.0",
"laravel/prompts": "^0.1.9",
"nunomaduro/termwind": "^1.13",
"symfony/console": "^6.3",
"symfony/process": "^6.3"
"symfony/console": "^7.0",
"symfony/process": "^7.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Cookie/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"illuminate/contracts": "^11.0",
"illuminate/macroable": "^11.0",
"illuminate/support": "^11.0",
"symfony/http-foundation": "^6.3",
"symfony/http-kernel": "^6.3"
"symfony/http-foundation": "^7.0",
"symfony/http-kernel": "^7.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"illuminate/events": "Required to use the observers with Eloquent (^11.0).",
"illuminate/filesystem": "Required to use the migrations (^11.0).",
"illuminate/pagination": "Required to paginate the result set (^11.0).",
"symfony/finder": "Required to use Eloquent model factories (^6.3)."
"symfony/finder": "Required to use Eloquent model factories (^7.0)."
},
"config": {
"sort-packages": true
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Filesystem/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"illuminate/contracts": "^11.0",
"illuminate/macroable": "^11.0",
"illuminate/support": "^11.0",
"symfony/finder": "^6.3"
"symfony/finder": "^7.0"
},
"autoload": {
"psr-4": {
Expand All @@ -41,8 +41,8 @@
"league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).",
"league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).",
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
"symfony/filesystem": "Required to enable support for relative symbolic links (^6.3).",
"symfony/mime": "Required to enable support for guessing extensions (^6.3)."
"symfony/filesystem": "Required to enable support for relative symbolic links (^7.0).",
"symfony/mime": "Required to enable support for guessing extensions (^7.0)."
},
"config": {
"sort-packages": true
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
8 changes: 4 additions & 4 deletions src/Illuminate/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ protected function filterFiles($files)
*/
public function hasSession(bool $skipIfUninitialized = false): bool
{
return ! is_null($this->session);
return $this->session instanceof SymfonySessionDecorator;
}

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

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

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

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

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Http/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
"require": {
"php": "^8.2",
"ext-filter": "*",
"fruitcake/php-cors": "^1.2",
"fruitcake/php-cors": "^1.3",
"guzzlehttp/uri-template": "^1.0",
"illuminate/collections": "^11.0",
"illuminate/macroable": "^11.0",
"illuminate/session": "^11.0",
"illuminate/support": "^11.0",
"symfony/http-foundation": "^6.3",
"symfony/http-kernel": "^6.3",
"symfony/mime": "^6.3"
"symfony/http-foundation": "^7.0",
"symfony/http-kernel": "^7.0",
"symfony/mime": "^7.0"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Mail/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"illuminate/support": "^11.0",
"league/commonmark": "^2.2",
"psr/log": "^1.0|^2.0|^3.0",
"symfony/mailer": "^6.3",
"symfony/mailer": "^7.0",
"tijsverkoyen/css-to-inline-styles": "^2.2.5"
},
"autoload": {
Expand All @@ -37,9 +37,9 @@
},
"suggest": {
"aws/aws-sdk-php": "Required to use the SES mail driver (^3.235.5).",
"symfony/http-client": "Required to use the Symfony API mail transports (^6.3).",
"symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.3).",
"symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.3)."
"symfony/http-client": "Required to use the Symfony API mail transports (^7.0).",
"symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.0).",
"symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.0)."
},
"config": {
"sort-packages": true
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Process/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"illuminate/contracts": "^10.0",
"illuminate/macroable": "^10.0",
"illuminate/support": "^10.0",
"symfony/process": "^6.3"
"symfony/process": "^7.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Queue/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"illuminate/support": "^11.0",
"laravel/serializable-closure": "^1.2.2",
"ramsey/uuid": "^4.7",
"symfony/process": "^6.3"
"symfony/process": "^7.0"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Routing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"illuminate/pipeline": "^11.0",
"illuminate/session": "^11.0",
"illuminate/support": "^11.0",
"symfony/http-foundation": "^6.3",
"symfony/http-kernel": "^6.3",
"symfony/routing": "^6.3"
"symfony/http-foundation": "^7.0",
"symfony/http-kernel": "^7.0",
"symfony/routing": "^7.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 838592e

Please sign in to comment.