mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-28 17:44:58 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -28,7 +28,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use function array_key_exists;
|
||||
|
||||
class ShortMessageCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
@@ -43,30 +42,28 @@ class ShortMessageCompilerPass implements CompilerPassInterface
|
||||
if ('null' === $dsn['scheme'] || false === $config['enabled']) {
|
||||
$defaultTransporter = new Reference(NullShortMessageSender::class);
|
||||
} elseif ('ovh' === $dsn['scheme']) {
|
||||
if (!class_exists('\\' . \Ovh\Api::class)) {
|
||||
if (!class_exists('\\'.\Ovh\Api::class)) {
|
||||
throw new RuntimeException('Class \\Ovh\\Api not found');
|
||||
}
|
||||
|
||||
foreach (['user', 'host', 'pass'] as $component) {
|
||||
if (!array_key_exists($component, $dsn)) {
|
||||
throw new RuntimeException(sprintf('The component %s does not exist in dsn. Please provide a dsn ' .
|
||||
'like ovh://applicationKey:applicationSecret@endpoint?consumerKey=xxxx&sender=yyyy&service_name=zzzz', $component));
|
||||
if (!\array_key_exists($component, $dsn)) {
|
||||
throw new RuntimeException(sprintf('The component %s does not exist in dsn. Please provide a dsn like ovh://applicationKey:applicationSecret@endpoint?consumerKey=xxxx&sender=yyyy&service_name=zzzz', $component));
|
||||
}
|
||||
|
||||
$container->setParameter('chill_main.short_messages.ovh_config_' . $component, $dsn[$component]);
|
||||
$container->setParameter('chill_main.short_messages.ovh_config_'.$component, $dsn[$component]);
|
||||
}
|
||||
|
||||
foreach (['consumer_key', 'sender', 'service_name'] as $param) {
|
||||
if (!array_key_exists($param, $dsn['queries'])) {
|
||||
throw new RuntimeException(sprintf('The parameter %s does not exist in dsn. Please provide a dsn ' .
|
||||
'like ovh://applicationKey:applicationSecret@endpoint?consumerKey=xxxx&sender=yyyy&service_name=zzzz', $param));
|
||||
if (!\array_key_exists($param, $dsn['queries'])) {
|
||||
throw new RuntimeException(sprintf('The parameter %s does not exist in dsn. Please provide a dsn like ovh://applicationKey:applicationSecret@endpoint?consumerKey=xxxx&sender=yyyy&service_name=zzzz', $param));
|
||||
}
|
||||
$container->setParameter('chill_main.short_messages.ovh_config_' . $param, $dsn['queries'][$param]);
|
||||
$container->setParameter('chill_main.short_messages.ovh_config_'.$param, $dsn['queries'][$param]);
|
||||
}
|
||||
|
||||
$ovh = new Definition();
|
||||
$ovh
|
||||
->setClass('\\' . \Ovh\Api::class)
|
||||
->setClass('\\'.\Ovh\Api::class)
|
||||
->setArgument(0, $dsn['user'])
|
||||
->setArgument(1, $dsn['pass'])
|
||||
->setArgument(2, $dsn['host'])
|
||||
|
Reference in New Issue
Block a user