| Conditions | 1 |
| Paths | 1 |
| Total Lines | 29 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function getConfigTreeBuilder(): TreeBuilder { |
||
| 31 | |||
| 32 | $assets = ConfigurationHelper::loadYamlConfig(__DIR__, "assets"); |
||
| 33 | $plugins = $assets["assets"]["wbw.adminbsb.asset.adminbsb"]["plugins"]; |
||
| 34 | $skins = SkinsThemeProvider::enumSkins(); |
||
| 35 | |||
| 36 | $treeBuilder = new TreeBuilder(WBWAdminBSBExtension::EXTENSION_ALIAS); |
||
| 37 | |||
| 38 | $rootNode = ConfigurationHelper::getRootNode($treeBuilder, WBWAdminBSBExtension::EXTENSION_ALIAS); |
||
| 39 | $rootNode |
||
| 40 | ->children() |
||
| 41 | ->booleanNode("twig")->defaultTrue()->info("Load Twig extensions")->end() |
||
| 42 | ->scalarNode("skin")->defaultValue("red")->info("AdminBSB skin") |
||
| 43 | ->validate() |
||
| 44 | ->ifNotInArray($skins) |
||
| 45 | ->thenInvalid("The AdminBSB skin %s is not supported. Please choose one of " . json_encode($skins)) |
||
| 46 | ->end() |
||
| 47 | ->end() |
||
| 48 | ->arrayNode("plugins")->info("AdminBSB plug-ins") |
||
| 49 | ->prototype("scalar") |
||
| 50 | ->validate() |
||
| 51 | ->ifNotInArray(array_keys($plugins)) |
||
| 52 | ->thenInvalid("The AdminBSB plug-in %s is not supported. Please choose one of " . json_encode(array_keys($plugins))) |
||
| 53 | ->end() |
||
| 54 | ->end() |
||
| 55 | ->end(); |
||
| 56 | |||
| 57 | return $treeBuilder; |
||
| 58 | } |
||
| 59 | } |
||
| 60 |