Skip to content

Commit

Permalink
Bump php-cs-fixer to version 3.60 (#1743)
Browse files Browse the repository at this point in the history
  • Loading branch information
jderusse authored Jul 30, 2024
1 parent 01b8ed8 commit dc845bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Changed

- Enable compiler optimization for the `sprintf` function.

## 1.12.2

### Changed
Expand Down
12 changes: 6 additions & 6 deletions src/DependencyInjection/AsyncAwsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private function registerConfiguredServices(ContainerBuilder $container, array $
foreach ($config['clients'] as $name => $data) {
$client = $availableServices[$data['type']]['class'];
if (!class_exists($client)) {
throw new InvalidConfigurationException(sprintf('You have configured "async_aws.%s" but the "%s" package is not installed. Try running "composer require %s"', $name, $data['type'], $availableServices[$data['type']]['package']));
throw new InvalidConfigurationException(\sprintf('You have configured "async_aws.%s" but the "%s" package is not installed. Try running "composer require %s"', $name, $data['type'], $availableServices[$data['type']]['package']));
}

$serviceConfig = array_merge($defaultConfig, $data);
Expand Down Expand Up @@ -200,7 +200,7 @@ private function addServiceDefinition(ContainerBuilder $container, string $name,
$logger,
]);
$definition->addTag('monolog.logger', ['channel' => 'async_aws']);
$container->setDefinition(sprintf('async_aws.client.%s', $name), $definition);
$container->setDefinition(\sprintf('async_aws.client.%s', $name), $definition);
}

/**
Expand Down Expand Up @@ -230,15 +230,15 @@ private function registerEnvLoader(ContainerBuilder $container, array $config):

$availableServices = AwsPackagesProvider::getAllServices();
if (!class_exists($className = $availableServices['ssm']['class'])) {
throw new InvalidConfigurationException(sprintf('You have enabled "async_aws.secrets" but the "%s" package is not installed. Try running "composer require %s"', 'ssm', $availableServices['ssm']['package']));
throw new InvalidConfigurationException(\sprintf('You have enabled "async_aws.secrets" but the "%s" package is not installed. Try running "composer require %s"', 'ssm', $availableServices['ssm']['package']));
}

if (null !== $client = $config['secrets']['client']) {
if (!isset($config['clients'][$client])) {
throw new InvalidConfigurationException(sprintf('The client "%s" configured in "async_aws.secrets" does not exists. Available clients are "%s"', $client, implode(', ', array_keys($config['clients']))));
throw new InvalidConfigurationException(\sprintf('The client "%s" configured in "async_aws.secrets" does not exists. Available clients are "%s"', $client, implode(', ', array_keys($config['clients']))));
}
if ('ssm' !== $config['clients'][$client]['type']) {
throw new InvalidConfigurationException(sprintf('The client "%s" configured in "async_aws.secrets" is not a SSM client.', $client));
throw new InvalidConfigurationException(\sprintf('The client "%s" configured in "async_aws.secrets" is not a SSM client.', $client));
}
} else {
if (!isset($config['clients']['ssm'])) {
Expand Down Expand Up @@ -289,7 +289,7 @@ private function autowireServices(ContainerBuilder $container, array $usedServic
continue;
}

$serviceId = sprintf('async_aws.client.%s', $name);
$serviceId = \sprintf('async_aws.client.%s', $name);
if (isset($awsServices[$name])) {
$container->setAlias($client, $serviceId);

Expand Down
4 changes: 2 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ private static function validateType(?array $clients): array
foreach ($clients as $name => $config) {
if (\in_array($name, $awsServices)) {
if (isset($config['type']) && $name !== $config['type']) {
throw new InvalidConfigurationException(sprintf('You cannot define a service named "%s" with type "%s". That is super confusing.', $name, $config['type']));
throw new InvalidConfigurationException(\sprintf('You cannot define a service named "%s" with type "%s". That is super confusing.', $name, $config['type']));
}
$clients[$name]['type'] = $name;
} elseif (!isset($config['type'])) {
if (!\in_array($name, $awsServices)) {
throw new InvalidConfigurationException(sprintf('The "async_aws.client.%s" does not have a type. We were unable to guess what AWS service you want. Please add "aws.service.%s.type".', $name, $name));
throw new InvalidConfigurationException(\sprintf('The "async_aws.client.%s" does not have a type. We were unable to guess what AWS service you want. Please add "aws.service.%s.type".', $name, $name));
}

$clients[$name]['type'] = $name;
Expand Down

0 comments on commit dc845bd

Please sign in to comment.