Skip to content

Commit 8c4c5b0

Browse files
Allow Symfony 7 (#1409)
* Allow Symfony 7 * Fix PHPUnit deprecations
1 parent f28182d commit 8c4c5b0

File tree

17 files changed

+48
-41
lines changed

17 files changed

+48
-41
lines changed

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"ext-hash": "*",
1212
"ext-json": "*",
1313
"psr/log": "^1.0 || ^2.0 || ^3.0",
14-
"symfony/http-client": "^4.4.16 || ^5.1.7 || ^6.0",
14+
"symfony/http-client": "^4.4.16 || ^5.1.7 || ^6.0 || ^7.0",
1515
"symfony/http-client-contracts": "^1.0 || ^2.0 || ^3.0",
16-
"symfony/process": "^4.4 || ^5.0 || ^6.0",
16+
"symfony/process": "^4.4 || ^5.0 || ^6.0 || ^7.0",
1717
"symfony/service-contracts": "^1.0 || ^2.0 || ^3.0"
1818
},
1919
"require-dev": {
@@ -32,15 +32,15 @@
3232
"nyholm/symfony-bundle-test": "1.x-dev#0555e4898e1b05655a4bdf52ba10c7f56611a514 as 1.9.0",
3333
"psr/cache": "^1.0 || ^2.0 || ^3.0",
3434
"swaggest/json-diff": "^3.7",
35-
"symfony/cache": "^4.4 || ^5.0 || ^6.0",
36-
"symfony/config": "^4.4 || ^5.0 || ^6.0",
37-
"symfony/console": "^4.4 || ^5.0 || ^6.0",
38-
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
35+
"symfony/cache": "^4.4 || ^5.0 || ^6.0 || ^7.0",
36+
"symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0",
37+
"symfony/console": "^4.4 || ^5.0 || ^6.0 || ^7.0",
38+
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0 || ^7.0",
3939
"symfony/deprecation-contracts": "^2.1 || ^3.0",
40-
"symfony/filesystem": "^5.0 || ^6.0",
41-
"symfony/finder": "^4.4 || ^5.0 || ^6.0",
42-
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0",
43-
"symfony/phpunit-bridge": "^5.3",
40+
"symfony/filesystem": "^5.0 || ^6.0 || ^7.0",
41+
"symfony/finder": "^4.4 || ^5.0 || ^6.0 || ^7.0",
42+
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0 || ^7.0",
43+
"symfony/phpunit-bridge": "^5.3 || ^6.0 || ^7.0",
4444
"symfony/polyfill-uuid": "^1.0"
4545
},
4646
"conflict": {

src/CodeGenerator/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"friendsofphp/php-cs-fixer": "^2.16",
1212
"nette/php-generator": "^3.3",
1313
"nette/utils": "^3.0",
14-
"symfony/console": "^4.4 || ^5.0 || ^6.0",
15-
"symfony/http-client": "^4.4 || ^5.0 || ^6.0",
14+
"symfony/console": "^4.4 || ^5.0 || ^6.0 || ^7.0",
15+
"symfony/http-client": "^4.4 || ^5.0 || ^6.0 || ^7.0",
1616
"symfony/http-client-contracts": "^1.0 || ^2.0 || ^3.0",
17-
"symfony/process": "^4.4 || ^5.0 || ^6.0",
17+
"symfony/process": "^4.4 || ^5.0 || ^6.0 || ^7.0",
1818
"symfony/service-contracts": "^2.0 || ^3.0"
1919
},
2020
"autoload": {

src/CodeGenerator/src/Command/GenerateCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use PhpCsFixer\Runner\Runner;
1717
use PhpCsFixer\ToolInfo;
1818
use Swaggest\JsonDiff\JsonPatch;
19+
use Symfony\Component\Console\Attribute\AsCommand;
1920
use Symfony\Component\Console\Command\Command;
2021
use Symfony\Component\Console\Input\InputArgument;
2122
use Symfony\Component\Console\Input\InputInterface;
@@ -30,6 +31,7 @@
3031
*
3132
* @author Tobias Nyholm <[email protected]>
3233
*/
34+
#[AsCommand(name: 'generate', description: 'Create or update API client methods.', aliases: ['update'])]
3335
class GenerateCommand extends Command
3436
{
3537
protected static $defaultName = 'generate';
@@ -69,7 +71,7 @@ protected function configure()
6971
]);
7072
}
7173

72-
protected function execute(InputInterface $input, OutputInterface $output)
74+
protected function execute(InputInterface $input, OutputInterface $output): int
7375
{
7476
/** @var ConsoleOutputInterface $output */
7577
$io = new SymfonyStyle($input, $output);

src/Core/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"psr/cache": "^1.0 || ^2.0 || ^3.0",
1919
"psr/log": "^1.0 || ^2.0 || ^3.0",
2020
"symfony/deprecation-contracts": "^2.1 || ^3.0",
21-
"symfony/http-client": "^4.4.16 || ^5.1.7 || ^6.0",
21+
"symfony/http-client": "^4.4.16 || ^5.1.7 || ^6.0 || ^7.0",
2222
"symfony/http-client-contracts": "^1.1.8 || ^2.0 || ^3.0",
2323
"symfony/service-contracts": "^1.0 || ^2.0 || ^3.0"
2424
},

src/Integration/Flysystem/S3/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"league/mime-type-detection": "^1.0"
2626
},
2727
"require-dev": {
28-
"symfony/phpunit-bridge": "^5.3"
28+
"symfony/phpunit-bridge": "^5.3 || ^6.0 || ^7.0"
2929
},
3030
"autoload": {
3131
"psr-4": {

src/Integration/Symfony/Bundle/composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"require": {
1515
"php": "^7.2.5 || ^8.0",
1616
"async-aws/core": "^1.0",
17-
"symfony/config": "^4.4 || ^5.0 || ^6.0",
18-
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
19-
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0"
17+
"symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0",
18+
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0 || ^7.0",
19+
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0 || ^7.0"
2020
},
2121
"require-dev": {
2222
"async-aws/s3": "^1.0",
@@ -25,7 +25,7 @@
2525
"async-aws/ssm": "^1.0",
2626
"matthiasnoback/symfony-config-test": "^4.1",
2727
"nyholm/symfony-bundle-test": "1.x-dev#0555e4898e1b05655a4bdf52ba10c7f56611a514 as 1.9.0",
28-
"symfony/cache": "^4.4 || ^5.0 || ^6.0"
28+
"symfony/cache": "^4.4 || ^5.0 || ^6.0 || ^7.0"
2929
},
3030
"autoload": {
3131
"psr-4": {

src/Service/CloudFormation/tests/Integration/CloudFormationClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testDescribeStackEvents(): void
4545
]);
4646
$result = $client->DescribeStackEvents($input);
4747

48-
self::assertCount(0, $result->getStackEvents());
48+
self::assertCount(0, iterator_to_array($result->getStackEvents()));
4949
self::assertNull($result->getNextToken());
5050
}
5151

src/Service/DynamoDb/tests/Unit/Result/ListTablesOutputTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testListTablesOutput(): void
3232

3333
break;
3434
}
35-
self::assertCount(4, $tableNames);
35+
self::assertCount(4, iterator_to_array($tableNames));
3636
self::assertNull($result->getLastEvaluatedTableName());
3737
}
3838
}

src/Service/DynamoDb/tests/Unit/Result/ScanOutputTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testScanOutput(): void
5252
break;
5353
}
5454

55-
self::assertCount(2, $items);
55+
self::assertCount(2, iterator_to_array($items));
5656
self::assertSame(2, $result->getCount());
5757
self::assertSame(3, $result->getScannedCount());
5858
}

src/Service/Iam/tests/Unit/Result/ListUsersResponseTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ public function testListUsersResponse(): void
4747
$result = new ListUsersResponse(new Response($client->request('POST', 'http://localhost'), $client, new NullLogger()), new IamClient(), new ListUsersRequest());
4848

4949
self::assertFalse($result->getIsTruncated());
50-
self::assertCount(2, $result->getUsers(true));
51-
self::assertSame('Juan', iterator_to_array($result->getUsers())[0]->getUserName());
52-
self::assertSame('Anika', iterator_to_array($result->getUsers())[1]->getUserName());
50+
$users = iterator_to_array($result->getUsers(true));
51+
self::assertCount(2, $users);
52+
self::assertSame('Juan', $users[0]->getUserName());
53+
self::assertSame('Anika', $users[1]->getUserName());
5354
}
5455
}

0 commit comments

Comments
 (0)