Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
lruozzi9 committed Jun 24, 2024
1 parent 35d6fc1 commit 86b0d7a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,30 @@

final class Configuration implements ConfigurationInterface
{
/**
* @psalm-suppress UnusedVariable
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('acme_sylius_example_plugin');
$rootNode = $treeBuilder->getRootNode();

$rootNode
->children()
->arrayNode('product_images')
->ignoreExtraKeys()
->addDefaultsIfNotSet()
->children()
->scalarNode('type')
->defaultValue('main')
->info('Type of the product image to send to Klarna. If none is specified or the type does not exists on current product then the first image will be used.')
->end()
->scalarNode('filter')
->defaultValue('sylius_medium')
->info('Liip filter to apply to the image. If none is specified then the original image will be used.')
->end()
->end()
->end()
->end()
;

return $treeBuilder;
}
}
7 changes: 7 additions & 0 deletions src/DependencyInjection/WebgriffeSyliusKlarnaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ final class WebgriffeSyliusKlarnaExtension extends AbstractResourceExtension imp
/** @psalm-suppress UnusedVariable */
public function load(array $configs, ContainerBuilder $container): void
{
$config = $this->processConfiguration($this->getConfiguration([], $container), $configs);

Check failure on line 21 in src/DependencyInjection/WebgriffeSyliusKlarnaExtension.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.12.0, PHP 8.2, Symfony ^6.4, MySQL 5.7

Parameter #1 $configuration of method Symfony\Component\DependencyInjection\Extension\Extension::processConfiguration() expects Symfony\Component\Config\Definition\ConfigurationInterface, Symfony\Component\Config\Definition\ConfigurationInterface|null given.

Check failure on line 21 in src/DependencyInjection/WebgriffeSyliusKlarnaExtension.php

View workflow job for this annotation

GitHub Actions / Sylius ~1.12.0, PHP 8.2, Symfony ^6.4, MySQL 8.0

Parameter #1 $configuration of method Symfony\Component\DependencyInjection\Extension\Extension::processConfiguration() expects Symfony\Component\Config\Definition\ConfigurationInterface, Symfony\Component\Config\Definition\ConfigurationInterface|null given.
$loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../../config'));

$loader->load('services.php');

$this->addImageOptionsConverters($container, $config);
}

public function prepend(ContainerBuilder $container): void
Expand All @@ -44,4 +47,8 @@ protected function getNamespacesOfMigrationsExecutedBefore(): array
'Sylius\Bundle\CoreBundle\Migrations',
];
}

private function addImageOptionsConverters(ContainerBuilder $container, array $config): void
{
}
}

0 comments on commit 86b0d7a

Please sign in to comment.