@@ -52,7 +52,7 @@ |
||
| 52 | 52 | |
| 53 | 53 | public function subscribe($email, $name, $listId = null) |
| 54 | 54 | { |
| 55 | - $listId = !is_null($listId) ? (int)$listId : (int)$this->getConfig('list_id'); |
|
| 55 | + $listId = !is_null($listId) ? (int)$listId : (int)$this->getConfig('list_id'); |
|
| 56 | 56 | return $this->post( |
| 57 | 57 | sprintf('subscribers/%d/', $listId), |
| 58 | 58 | [ |
@@ -12,21 +12,21 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class Configuration implements ConfigurationInterface |
| 14 | 14 | { |
| 15 | - /** |
|
| 16 | - * {@inheritdoc} |
|
| 17 | - */ |
|
| 18 | - public function getConfigTreeBuilder() |
|
| 19 | - { |
|
| 20 | - $treeBuilder = new TreeBuilder(); |
|
| 21 | - $rootNode = $treeBuilder->root('mailerlite'); |
|
| 15 | + /** |
|
| 16 | + * {@inheritdoc} |
|
| 17 | + */ |
|
| 18 | + public function getConfigTreeBuilder() |
|
| 19 | + { |
|
| 20 | + $treeBuilder = new TreeBuilder(); |
|
| 21 | + $rootNode = $treeBuilder->root('mailerlite'); |
|
| 22 | 22 | |
| 23 | - $rootNode |
|
| 24 | - ->children() |
|
| 25 | - ->scalarNode('api_key')->cannotBeEmpty()->end() |
|
| 26 | - ->integerNode('list_id')->cannotBeEmpty()->end() |
|
| 27 | - ->end() |
|
| 28 | - ; |
|
| 23 | + $rootNode |
|
| 24 | + ->children() |
|
| 25 | + ->scalarNode('api_key')->cannotBeEmpty()->end() |
|
| 26 | + ->integerNode('list_id')->cannotBeEmpty()->end() |
|
| 27 | + ->end() |
|
| 28 | + ; |
|
| 29 | 29 | |
| 30 | - return $treeBuilder; |
|
| 31 | - } |
|
| 30 | + return $treeBuilder; |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -14,23 +14,23 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class MailerliteExtension extends Extension |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * {@inheritdoc} |
|
| 19 | - */ |
|
| 20 | - public function load(array $configs, ContainerBuilder $container) |
|
| 21 | - { |
|
| 22 | - $configuration = new Configuration(); |
|
| 23 | - $config = $this->processConfiguration($configuration, $configs); |
|
| 17 | + /** |
|
| 18 | + * {@inheritdoc} |
|
| 19 | + */ |
|
| 20 | + public function load(array $configs, ContainerBuilder $container) |
|
| 21 | + { |
|
| 22 | + $configuration = new Configuration(); |
|
| 23 | + $config = $this->processConfiguration($configuration, $configs); |
|
| 24 | 24 | |
| 25 | - if (isset($config['api_key'])) { |
|
| 26 | - $container->setParameter('mailerlite.api.key', $config['api_key']); |
|
| 27 | - } |
|
| 25 | + if (isset($config['api_key'])) { |
|
| 26 | + $container->setParameter('mailerlite.api.key', $config['api_key']); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - if (isset($config['list_id'])) { |
|
| 30 | - $container->setParameter('mailerlite.list_id', $config['list_id']); |
|
| 31 | - } |
|
| 29 | + if (isset($config['list_id'])) { |
|
| 30 | + $container->setParameter('mailerlite.list_id', $config['list_id']); |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 34 | - $loader->load('services.yml'); |
|
| 35 | - } |
|
| 33 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 34 | + $loader->load('services.yml'); |
|
| 35 | + } |
|
| 36 | 36 | } |