3 namespace Rapsys\AirBundle\DependencyInjection
;
5 use Symfony\Component\Config\Definition\Builder\TreeBuilder
;
6 use Symfony\Component\Config\Definition\ConfigurationInterface
;
9 * This is the class that validates and merges configuration from your app/config files.
11 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
13 class Configuration
implements ConfigurationInterface
{
17 public function getConfigTreeBuilder() {
18 $treeBuilder = new TreeBuilder('rapsys_air');
20 // Here you should define the parameters that are allowed to
21 // configure your bundle. See the documentation linked above for
22 // more information on that topic.
26 'ico' => '@RapsysAir/ico/icon.ico',
27 'logo' => '@RapsysAir/png/logo.png',
29 //XXX: see https://www.emergeinteractive.com/insights/detail/the-essentials-of-favicons/
30 //XXX: see https://caniuse.com/#feat=link-icon-svg
33 256 => '@RapsysAir/png/icon.256.png',
36 //Chrome for Android home screen icon
37 196 => '@RapsysAir/png/icon.196.png',
38 //Google Developer Web App Manifest Recommendation
39 192 => '@RapsysAir/png/icon.192.png',
40 //Chrome Web Store icon
41 128 => '@RapsysAir/png/icon.128.png',
44 32 => '@RapsysAir/png/icon.32.png',
47 //XXX: old obsolete format: [57, 72, 76, 114, 120, 144]
48 //XXX: see https://webhint.io/docs/user-guide/hints/hint-apple-touch-icons/
49 //XXX: see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
51 180 => '@RapsysAir/png/icon.180.png',
52 //iPad Retina touch icon
53 167 => '@RapsysAir/png/icon.167.png',
55 152 => '@RapsysAir/png/icon.152.png',
57 120 => '@RapsysAir/png/icon.120.png',
60 //XXX: see https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn255024(v=vs.85)
61 310 => '@RapsysAir/png/icon.310.png',
62 150 => '@RapsysAir/png/icon.150.png',
63 70 => '@RapsysAir/png/icon.70.png'
65 'svg' => '@RapsysAir/svg/icon.svg',
66 'title' => 'Libre Air',
70 'long' => 'All rights reserved',
71 'short' => 'Copyright 2019'
75 'mail' => 'contact@example.com'
77 'locale' => '%kernel.default_locale%',
78 'locales' => '%kernel.translator.fallbacks%',
79 'languages' => '%rapsys_user.languages%',
82 //Here we define the parameters that are allowed to configure the bundle.
83 //TODO: see https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php for default value and description
84 //TODO: see http://symfony.com/doc/current/components/config/definition.html
85 //XXX: use bin/console config:dump-reference to dump class infos
87 //Here we define the parameters that are allowed to configure the bundle.
91 ->addDefaultsIfNotSet()
94 ->addDefaultsIfNotSet()
96 ->scalarNode('ico')->cannotBeEmpty()->defaultValue($defaults['site']['ico'])->end()
97 ->scalarNode('logo')->cannotBeEmpty()->defaultValue($defaults['site']['logo'])->end()
100 ->defaultValue($defaults['site']['png'])
101 ->scalarPrototype()->end()
103 ->scalarNode('svg')->cannotBeEmpty()->defaultValue($defaults['site']['svg'])->end()
104 ->scalarNode('title')->cannotBeEmpty()->defaultValue($defaults['site']['title'])->end()
105 ->scalarNode('url')->cannotBeEmpty()->defaultValue($defaults['site']['url'])->end()
109 ->addDefaultsIfNotSet()
111 ->scalarNode('long')->defaultValue($defaults['copy']['long'])->end()
112 ->scalarNode('short')->defaultValue($defaults['copy']['short'])->end()
115 ->arrayNode('contact')
116 ->addDefaultsIfNotSet()
118 ->scalarNode('name')->cannotBeEmpty()->defaultValue($defaults['contact']['name'])->end()
119 ->scalarNode('mail')->cannotBeEmpty()->defaultValue($defaults['contact']['mail'])->end()
122 ->scalarNode('locale')->cannotBeEmpty()->defaultValue($defaults['locale'])->end()
123 ->scalarNode('locales')->cannotBeEmpty()->defaultValue($defaults['locales'])->end()
124 ->scalarNode('languages')->cannotBeEmpty()->defaultValue($defaults['languages'])->end()