diff --git a/composer.json b/composer.json index cf8271177..aa93cfb55 100644 --- a/composer.json +++ b/composer.json @@ -11,9 +11,9 @@ "ext-hash": "*", "ext-json": "*", "psr/log": "^1.0 || ^2.0 || ^3.0", - "symfony/http-client": "^4.4.16 || ^5.1.7 || ^6.0", + "symfony/http-client": "^4.4.16 || ^5.1.7 || ^6.0 || ^7.0", "symfony/http-client-contracts": "^1.0 || ^2.0 || ^3.0", - "symfony/process": "^4.4 || ^5.0 || ^6.0", + "symfony/process": "^4.4 || ^5.0 || ^6.0 || ^7.0", "symfony/service-contracts": "^1.0 || ^2.0 || ^3.0" }, "require-dev": { @@ -32,15 +32,15 @@ "nyholm/symfony-bundle-test": "1.x-dev#0555e4898e1b05655a4bdf52ba10c7f56611a514 as 1.9.0", "psr/cache": "^1.0 || ^2.0 || ^3.0", "swaggest/json-diff": "^3.7", - "symfony/cache": "^4.4 || ^5.0 || ^6.0", - "symfony/config": "^4.4 || ^5.0 || ^6.0", - "symfony/console": "^4.4 || ^5.0 || ^6.0", - "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", + "symfony/cache": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/console": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0 || ^7.0", "symfony/deprecation-contracts": "^2.1 || ^3.0", - "symfony/filesystem": "^5.0 || ^6.0", - "symfony/finder": "^4.4 || ^5.0 || ^6.0", - "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0", - "symfony/phpunit-bridge": "^5.3", + "symfony/filesystem": "^5.0 || ^6.0 || ^7.0", + "symfony/finder": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/phpunit-bridge": "^5.3 || ^6.0 || ^7.0", "symfony/polyfill-uuid": "^1.0" }, "conflict": { diff --git a/src/CodeGenerator/composer.json b/src/CodeGenerator/composer.json index 50b0a67e7..f38685b1b 100644 --- a/src/CodeGenerator/composer.json +++ b/src/CodeGenerator/composer.json @@ -11,10 +11,10 @@ "friendsofphp/php-cs-fixer": "^2.16", "nette/php-generator": "^3.3", "nette/utils": "^3.0", - "symfony/console": "^4.4 || ^5.0 || ^6.0", - "symfony/http-client": "^4.4 || ^5.0 || ^6.0", + "symfony/console": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/http-client": "^4.4 || ^5.0 || ^6.0 || ^7.0", "symfony/http-client-contracts": "^1.0 || ^2.0 || ^3.0", - "symfony/process": "^4.4 || ^5.0 || ^6.0", + "symfony/process": "^4.4 || ^5.0 || ^6.0 || ^7.0", "symfony/service-contracts": "^2.0 || ^3.0" }, "autoload": { diff --git a/src/CodeGenerator/src/Command/GenerateCommand.php b/src/CodeGenerator/src/Command/GenerateCommand.php index 8322cc915..9e4464674 100644 --- a/src/CodeGenerator/src/Command/GenerateCommand.php +++ b/src/CodeGenerator/src/Command/GenerateCommand.php @@ -16,6 +16,7 @@ use PhpCsFixer\Runner\Runner; use PhpCsFixer\ToolInfo; use Swaggest\JsonDiff\JsonPatch; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -30,6 +31,7 @@ * * @author Tobias Nyholm */ +#[AsCommand(name: 'generate', description: 'Create or update API client methods.', aliases: ['update'])] class GenerateCommand extends Command { protected static $defaultName = 'generate'; @@ -69,7 +71,7 @@ protected function configure() ]); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { /** @var ConsoleOutputInterface $output */ $io = new SymfonyStyle($input, $output); diff --git a/src/Core/composer.json b/src/Core/composer.json index 962cb6bf1..3c0f0c900 100644 --- a/src/Core/composer.json +++ b/src/Core/composer.json @@ -18,7 +18,7 @@ "psr/cache": "^1.0 || ^2.0 || ^3.0", "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/deprecation-contracts": "^2.1 || ^3.0", - "symfony/http-client": "^4.4.16 || ^5.1.7 || ^6.0", + "symfony/http-client": "^4.4.16 || ^5.1.7 || ^6.0 || ^7.0", "symfony/http-client-contracts": "^1.1.8 || ^2.0 || ^3.0", "symfony/service-contracts": "^1.0 || ^2.0 || ^3.0" }, diff --git a/src/Integration/Flysystem/S3/composer.json b/src/Integration/Flysystem/S3/composer.json index 9f34b784b..0ab0b16a3 100644 --- a/src/Integration/Flysystem/S3/composer.json +++ b/src/Integration/Flysystem/S3/composer.json @@ -25,7 +25,7 @@ "league/mime-type-detection": "^1.0" }, "require-dev": { - "symfony/phpunit-bridge": "^5.3" + "symfony/phpunit-bridge": "^5.3 || ^6.0 || ^7.0" }, "autoload": { "psr-4": { diff --git a/src/Integration/Symfony/Bundle/composer.json b/src/Integration/Symfony/Bundle/composer.json index 3f95b8047..a9220b918 100644 --- a/src/Integration/Symfony/Bundle/composer.json +++ b/src/Integration/Symfony/Bundle/composer.json @@ -14,9 +14,9 @@ "require": { "php": "^7.2.5 || ^8.0", "async-aws/core": "^1.0", - "symfony/config": "^4.4 || ^5.0 || ^6.0", - "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", - "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0" + "symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/http-kernel": "^4.4 || ^5.0 || ^6.0 || ^7.0" }, "require-dev": { "async-aws/s3": "^1.0", @@ -25,7 +25,7 @@ "async-aws/ssm": "^1.0", "matthiasnoback/symfony-config-test": "^4.1", "nyholm/symfony-bundle-test": "1.x-dev#0555e4898e1b05655a4bdf52ba10c7f56611a514 as 1.9.0", - "symfony/cache": "^4.4 || ^5.0 || ^6.0" + "symfony/cache": "^4.4 || ^5.0 || ^6.0 || ^7.0" }, "autoload": { "psr-4": { diff --git a/src/Service/CloudFormation/tests/Integration/CloudFormationClientTest.php b/src/Service/CloudFormation/tests/Integration/CloudFormationClientTest.php index d235eb5cb..07e42d681 100644 --- a/src/Service/CloudFormation/tests/Integration/CloudFormationClientTest.php +++ b/src/Service/CloudFormation/tests/Integration/CloudFormationClientTest.php @@ -45,7 +45,7 @@ public function testDescribeStackEvents(): void ]); $result = $client->DescribeStackEvents($input); - self::assertCount(0, $result->getStackEvents()); + self::assertCount(0, iterator_to_array($result->getStackEvents())); self::assertNull($result->getNextToken()); } diff --git a/src/Service/DynamoDb/tests/Unit/Result/ListTablesOutputTest.php b/src/Service/DynamoDb/tests/Unit/Result/ListTablesOutputTest.php index 12a46abfd..0cd37ef34 100644 --- a/src/Service/DynamoDb/tests/Unit/Result/ListTablesOutputTest.php +++ b/src/Service/DynamoDb/tests/Unit/Result/ListTablesOutputTest.php @@ -32,7 +32,7 @@ public function testListTablesOutput(): void break; } - self::assertCount(4, $tableNames); + self::assertCount(4, iterator_to_array($tableNames)); self::assertNull($result->getLastEvaluatedTableName()); } } diff --git a/src/Service/DynamoDb/tests/Unit/Result/ScanOutputTest.php b/src/Service/DynamoDb/tests/Unit/Result/ScanOutputTest.php index 72d892f2a..02151ffb1 100644 --- a/src/Service/DynamoDb/tests/Unit/Result/ScanOutputTest.php +++ b/src/Service/DynamoDb/tests/Unit/Result/ScanOutputTest.php @@ -52,7 +52,7 @@ public function testScanOutput(): void break; } - self::assertCount(2, $items); + self::assertCount(2, iterator_to_array($items)); self::assertSame(2, $result->getCount()); self::assertSame(3, $result->getScannedCount()); } diff --git a/src/Service/Iam/tests/Unit/Result/ListUsersResponseTest.php b/src/Service/Iam/tests/Unit/Result/ListUsersResponseTest.php index abe5046cc..e206fb21b 100644 --- a/src/Service/Iam/tests/Unit/Result/ListUsersResponseTest.php +++ b/src/Service/Iam/tests/Unit/Result/ListUsersResponseTest.php @@ -47,8 +47,9 @@ public function testListUsersResponse(): void $result = new ListUsersResponse(new Response($client->request('POST', 'http://localhost'), $client, new NullLogger()), new IamClient(), new ListUsersRequest()); self::assertFalse($result->getIsTruncated()); - self::assertCount(2, $result->getUsers(true)); - self::assertSame('Juan', iterator_to_array($result->getUsers())[0]->getUserName()); - self::assertSame('Anika', iterator_to_array($result->getUsers())[1]->getUserName()); + $users = iterator_to_array($result->getUsers(true)); + self::assertCount(2, $users); + self::assertSame('Juan', $users[0]->getUserName()); + self::assertSame('Anika', $users[1]->getUserName()); } } diff --git a/src/Service/Kinesis/tests/Integration/KinesisClientTest.php b/src/Service/Kinesis/tests/Integration/KinesisClientTest.php index d616dc55d..d838609f1 100644 --- a/src/Service/Kinesis/tests/Integration/KinesisClientTest.php +++ b/src/Service/Kinesis/tests/Integration/KinesisClientTest.php @@ -327,8 +327,9 @@ public function testListStreamConsumers(): void $result->resolve(); - self::assertCount(1, $result->getConsumers()); - self::assertSame('demo', iterator_to_array($result->getConsumers())[0]->getConsumerName()); + $consumers = iterator_to_array($result->getConsumers()); + self::assertCount(1, $consumers); + self::assertSame('demo', $consumers[0]->getConsumerName()); } public function testListStreams(): void @@ -341,8 +342,9 @@ public function testListStreams(): void $input = new ListStreamsInput([]); $result = $client->listStreams($input); - self::assertGreaterThanOrEqual(1, iterator_to_array($result->getStreamNames())); - self::assertContains(__FUNCTION__, iterator_to_array($result->getStreamNames())); + $streamNames = iterator_to_array($result->getStreamNames()); + self::assertGreaterThanOrEqual(1, \count($streamNames)); + self::assertContains(__FUNCTION__, $streamNames); } public function testListTagsForStream(): void diff --git a/src/Service/Kinesis/tests/Unit/Result/ListStreamConsumersOutputTest.php b/src/Service/Kinesis/tests/Unit/Result/ListStreamConsumersOutputTest.php index 3398979b1..16ab7a692 100644 --- a/src/Service/Kinesis/tests/Unit/Result/ListStreamConsumersOutputTest.php +++ b/src/Service/Kinesis/tests/Unit/Result/ListStreamConsumersOutputTest.php @@ -32,7 +32,8 @@ public function testListStreamConsumersOutput(): void $result = new ListStreamConsumersOutput(new Response($client->request('POST', 'http://localhost'), $client, new NullLogger()), new KinesisClient(), new ListStreamConsumersInput([])); // self::assertTODO(expected, $result->getConsumers()); - self::assertCount(1, $result->getConsumers(true)); - self::assertSame('arn', iterator_to_array($result->getConsumers(true))[0]->getConsumerArn()); + $consumers = iterator_to_array($result->getConsumers(true)); + self::assertCount(1, $consumers); + self::assertSame('arn', $consumers[0]->getConsumerArn()); } } diff --git a/src/Service/Route53/tests/Integration/Route53ClientTest.php b/src/Service/Route53/tests/Integration/Route53ClientTest.php index 9fc64b6f2..2a1b58f67 100644 --- a/src/Service/Route53/tests/Integration/Route53ClientTest.php +++ b/src/Service/Route53/tests/Integration/Route53ClientTest.php @@ -221,7 +221,7 @@ public function testListResourceRecordSets(): void $result->resolve(); - self::assertCount(2, $result->getResourceRecordSets()); + self::assertCount(2, iterator_to_array($result->getResourceRecordSets())); self::assertFalse($result->getIsTruncated()); self::assertNull($result->getNextRecordName()); } diff --git a/src/Service/Route53/tests/Unit/Result/ListResourceRecordSetsResponseTest.php b/src/Service/Route53/tests/Unit/Result/ListResourceRecordSetsResponseTest.php index 713748016..acb700146 100644 --- a/src/Service/Route53/tests/Unit/Result/ListResourceRecordSetsResponseTest.php +++ b/src/Service/Route53/tests/Unit/Result/ListResourceRecordSetsResponseTest.php @@ -40,7 +40,7 @@ public function testListResourceRecordSetsResponse(): void $client = new MockHttpClient($response); $result = new ListResourceRecordSetsResponse(new Response($client->request('POST', 'http://localhost'), $client, new NullLogger()), new Route53Client(), new ListResourceRecordSetsRequest()); - self::assertCount(1, $result->getResourceRecordSets()); + self::assertCount(1, iterator_to_array($result->getResourceRecordSets())); self::assertFalse($result->getIsTruncated()); self::assertNull($result->getNextRecordName()); self::assertNull($result->getNextRecordType()); diff --git a/src/Service/S3/tests/Unit/Result/ListObjectsV2OutputTest.php b/src/Service/S3/tests/Unit/Result/ListObjectsV2OutputTest.php index ca9dcf827..21898883b 100644 --- a/src/Service/S3/tests/Unit/Result/ListObjectsV2OutputTest.php +++ b/src/Service/S3/tests/Unit/Result/ListObjectsV2OutputTest.php @@ -60,6 +60,6 @@ public function testNoObjects() $result = new ListObjectsV2Output(new Response($client->request('POST', 'http://localhost'), $client, new NullLogger())); $content = $result->getContents(true); - self::assertCount(0, $content); + self::assertCount(0, iterator_to_array($content)); } } diff --git a/src/Service/Sns/tests/Integration/SnsClientTest.php b/src/Service/Sns/tests/Integration/SnsClientTest.php index e209b42e8..ae1b81c4a 100644 --- a/src/Service/Sns/tests/Integration/SnsClientTest.php +++ b/src/Service/Sns/tests/Integration/SnsClientTest.php @@ -118,9 +118,9 @@ public function testListSubscriptionsByTopic(): void ]); $result = $client->ListSubscriptionsByTopic($input); - self::assertCount(1, $result->getSubscriptions()); - $subscription = iterator_to_array($result->getSubscriptions())[0]; - self::assertSame('http://async-aws.com', $subscription->getEndpoint()); + $subscriptions = iterator_to_array($result->getSubscriptions()); + self::assertCount(1, $subscriptions); + self::assertSame('http://async-aws.com', $subscriptions[0]->getEndpoint()); } public function testPublish(): void diff --git a/src/Service/Ssm/tests/Unit/Result/GetParametersByPathResultTest.php b/src/Service/Ssm/tests/Unit/Result/GetParametersByPathResultTest.php index 1361b1c3d..46950bc7d 100644 --- a/src/Service/Ssm/tests/Unit/Result/GetParametersByPathResultTest.php +++ b/src/Service/Ssm/tests/Unit/Result/GetParametersByPathResultTest.php @@ -55,9 +55,10 @@ public function testGetParametersByPathResult(): void $client = new MockHttpClient($response); $result = new GetParametersByPathResult(new Response($client->request('POST', 'http://localhost'), $client, new NullLogger()), new SsmClient(), new GetParametersByPathRequest()); - self::assertCount(5, $result->getParameters(true)); - self::assertInstanceOf(Parameter::class, iterator_to_array($result->getParameters())[0]); - self::assertSame('/Branch312/Dev/Engineer1', iterator_to_array($result->getParameters())[0]->getName()); + $parameters = iterator_to_array($result->getParameters(true)); + self::assertCount(5, $parameters); + self::assertInstanceOf(Parameter::class, $parameters[0]); + self::assertSame('/Branch312/Dev/Engineer1', $parameters[0]->getName()); self::assertCount(5, iterator_to_array($result)); self::assertInstanceOf(Parameter::class, iterator_to_array($result)[0]); }