Skip to content

Allow Symfony 7 #1409

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

Merged
merged 2 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions src/CodeGenerator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 3 additions & 1 deletion src/CodeGenerator/src/Command/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,6 +31,7 @@
*
* @author Tobias Nyholm <[email protected]>
*/
#[AsCommand(name: 'generate', description: 'Create or update API client methods.', aliases: ['update'])]
class GenerateCommand extends Command
{
protected static $defaultName = 'generate';
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Integration/Flysystem/S3/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions src/Integration/Symfony/Bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testListTablesOutput(): void

break;
}
self::assertCount(4, $tableNames);
self::assertCount(4, iterator_to_array($tableNames));
self::assertNull($result->getLastEvaluatedTableName());
}
}
2 changes: 1 addition & 1 deletion src/Service/DynamoDb/tests/Unit/Result/ScanOutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
7 changes: 4 additions & 3 deletions src/Service/Iam/tests/Unit/Result/ListUsersResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
10 changes: 6 additions & 4 deletions src/Service/Kinesis/tests/Integration/KinesisClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
6 changes: 3 additions & 3 deletions src/Service/Sns/tests/Integration/SnsClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down