You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
fix: symfony configuration
This commit is contained in:
@@ -20,7 +20,7 @@ namespace Flasher\Prime\Config;
|
||||
* }>,
|
||||
* auto_render: bool,
|
||||
* auto_translate: bool,
|
||||
* search_criteria: array<string, mixed>,
|
||||
* filter_criteria: array<string, mixed>,
|
||||
* flash_bag: array{
|
||||
* enabled: bool,
|
||||
* mapping: array<string, string[]>,
|
||||
|
||||
@@ -38,7 +38,8 @@ final class Configuration implements ConfigurationInterface
|
||||
->cannotBeEmpty()
|
||||
->defaultValue($plugin->getDefault())
|
||||
->end()
|
||||
->scalarNode('root_script')
|
||||
->arrayNode('root_script')
|
||||
->prototype('scalar')->end()
|
||||
->defaultValue($plugin->getRootScript())
|
||||
->end()
|
||||
->arrayNode('options')
|
||||
@@ -47,7 +48,7 @@ final class Configuration implements ConfigurationInterface
|
||||
->booleanNode('use_cdn')->defaultTrue()->end()
|
||||
->booleanNode('auto_translate')->defaultTrue()->end()
|
||||
->booleanNode('auto_render')->defaultTrue()->end()
|
||||
->arrayNode('search_criteria')
|
||||
->arrayNode('filter_criteria')
|
||||
->prototype('scalar')->end()
|
||||
->end()
|
||||
->end()
|
||||
|
||||
@@ -154,7 +154,7 @@ final class FlasherExtension extends Extension implements CompilerPassInterface
|
||||
*/
|
||||
private function registerStorageManager(array $config, ContainerBuilder $container)
|
||||
{
|
||||
$criteria = $config['search_criteria'];
|
||||
$criteria = $config['filter_criteria'];
|
||||
$storageManager = $container->getDefinition('flasher.storage_manager');
|
||||
$storageManager->replaceArgument(2, $criteria);
|
||||
}
|
||||
|
||||
@@ -34,11 +34,11 @@ class Configuration implements ConfigurationInterface
|
||||
$rootNode
|
||||
->children()
|
||||
->arrayNode('scripts')
|
||||
->prototype('scalar')->end()
|
||||
->prototype('variable')->end()
|
||||
->defaultValue($this->plugin->getScripts())
|
||||
->end()
|
||||
->arrayNode('styles')
|
||||
->prototype('scalar')->end()
|
||||
->prototype('variable')->end()
|
||||
->defaultValue($this->plugin->getStyles())
|
||||
->end()
|
||||
->arrayNode('options')
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace Flasher\Symfony\Support;
|
||||
use Flasher\Prime\Plugin\PluginInterface;
|
||||
use Flasher\Symfony\Bridge\Bridge;
|
||||
use Flasher\Symfony\Bridge\DependencyInjection\FlasherExtension;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
use Symfony\Component\DependencyInjection\ChildDefinition;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
@@ -62,6 +63,18 @@ final class Extension extends FlasherExtension implements CompilerPassInterface
|
||||
return $this->plugin->getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns extension configuration.
|
||||
*
|
||||
* @param array<int, array<string, mixed>> $config
|
||||
*
|
||||
* @return ConfigurationInterface|null
|
||||
*/
|
||||
public function getConfiguration(array $config, ContainerBuilder $container)
|
||||
{
|
||||
return new Configuration($this->plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user