You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-06 13:02:55 +01:00
e13aa4cc60
update PHP Coding Standards Fixer
48 lines
1.5 KiB
PHP
Executable File
48 lines
1.5 KiB
PHP
Executable File
<?php
|
|
|
|
namespace Flasher\Toastr\Symfony\DependencyInjection;
|
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
|
|
|
final class Configuration implements ConfigurationInterface
|
|
{
|
|
public function getConfigTreeBuilder()
|
|
{
|
|
$treeBuilder = new TreeBuilder('flasher_toastr');
|
|
|
|
if (\method_exists($treeBuilder, 'getRootNode')) {
|
|
$rootNode = $treeBuilder->getRootNode();
|
|
} else {
|
|
// BC layer for symfony/config 4.1 and older
|
|
$rootNode = $treeBuilder->root('flasher_toastr');
|
|
}
|
|
|
|
$rootNode
|
|
->children()
|
|
->arrayNode('scripts')
|
|
->prototype('scalar')->end()
|
|
->defaultValue(array(
|
|
'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js',
|
|
'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@0.1.3/dist/flasher-toastr.min.js',
|
|
))
|
|
->end()
|
|
->arrayNode('styles')
|
|
->prototype('scalar')->end()
|
|
->defaultValue(array())
|
|
->end()
|
|
->arrayNode('options')
|
|
->prototype('variable')->end()
|
|
->ignoreExtraKeys(false)
|
|
->defaultValue(array(
|
|
'progressBar' => true,
|
|
'timeOut' => 5000,
|
|
))
|
|
->end()
|
|
->end()
|
|
;
|
|
|
|
return $treeBuilder;
|
|
}
|
|
}
|