1 | <?php |
||||
2 | |||||
3 | declare(strict_types=1); |
||||
4 | |||||
5 | namespace Odiseo\BlogBundle\DependencyInjection; |
||||
6 | |||||
7 | use Odiseo\BlogBundle\Doctrine\ORM\ArticleCategoryRepository; |
||||
8 | use Odiseo\BlogBundle\Doctrine\ORM\ArticleRepository; |
||||
9 | use Odiseo\BlogBundle\Factory\ArticleCommentFactory; |
||||
10 | use Odiseo\BlogBundle\Form\Type\ArticleCategoryTranslationType; |
||||
11 | use Odiseo\BlogBundle\Form\Type\ArticleCategoryType; |
||||
12 | use Odiseo\BlogBundle\Form\Type\ArticleCommentType; |
||||
13 | use Odiseo\BlogBundle\Form\Type\ArticleTranslationType; |
||||
14 | use Odiseo\BlogBundle\Form\Type\ArticleType; |
||||
15 | use Odiseo\BlogBundle\Form\Type\ArticleImageType; |
||||
16 | use Odiseo\BlogBundle\Model\Article; |
||||
17 | use Odiseo\BlogBundle\Model\ArticleCategory; |
||||
18 | use Odiseo\BlogBundle\Model\ArticleCategoryInterface; |
||||
19 | use Odiseo\BlogBundle\Model\ArticleCategoryTranslation; |
||||
20 | use Odiseo\BlogBundle\Model\ArticleCategoryTranslationInterface; |
||||
21 | use Odiseo\BlogBundle\Model\ArticleComment; |
||||
22 | use Odiseo\BlogBundle\Model\ArticleCommentInterface; |
||||
23 | use Odiseo\BlogBundle\Model\ArticleImage; |
||||
24 | use Odiseo\BlogBundle\Model\ArticleImageInterface; |
||||
25 | use Odiseo\BlogBundle\Model\ArticleInterface; |
||||
26 | use Odiseo\BlogBundle\Model\ArticleTranslation; |
||||
27 | use Odiseo\BlogBundle\Model\ArticleTranslationInterface; |
||||
28 | use Sylius\Bundle\ResourceBundle\Controller\ResourceController; |
||||
29 | use Sylius\Bundle\ResourceBundle\SyliusResourceBundle; |
||||
30 | use Sylius\Component\Resource\Factory\Factory; |
||||
31 | use Sylius\Component\Resource\Factory\TranslatableFactory; |
||||
32 | use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; |
||||
33 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
||||
34 | use Symfony\Component\Config\Definition\ConfigurationInterface; |
||||
35 | |||||
36 | /** |
||||
37 | * This class contains the configuration information for the bundle. |
||||
38 | * |
||||
39 | * This information is solely responsible for how the different configuration |
||||
40 | * sections are normalized, and merged. |
||||
41 | * |
||||
42 | * @author Diego D'amico <[email protected]> |
||||
43 | */ |
||||
44 | final class Configuration implements ConfigurationInterface |
||||
45 | { |
||||
46 | /** |
||||
47 | * {@inheritdoc} |
||||
48 | */ |
||||
49 | public function getConfigTreeBuilder(): TreeBuilder |
||||
50 | { |
||||
51 | $treeBuilder = new TreeBuilder('odiseo_blog'); |
||||
52 | $rootNode = $treeBuilder->getRootNode(); |
||||
53 | |||||
54 | $rootNode |
||||
55 | ->addDefaultsIfNotSet() |
||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||
56 | ->children() |
||||
57 | ->scalarNode('driver')->defaultValue(SyliusResourceBundle::DRIVER_DOCTRINE_ORM)->end() |
||||
58 | ->end() |
||||
59 | ; |
||||
60 | |||||
61 | $this->addResourcesSection($rootNode); |
||||
62 | |||||
63 | return $treeBuilder; |
||||
64 | } |
||||
65 | |||||
66 | /** |
||||
67 | * @param ArrayNodeDefinition $node |
||||
68 | */ |
||||
69 | private function addResourcesSection(ArrayNodeDefinition $node) |
||||
70 | { |
||||
71 | $node |
||||
72 | ->children() |
||||
73 | ->arrayNode('resources') |
||||
74 | ->addDefaultsIfNotSet() |
||||
75 | ->children() |
||||
76 | ->arrayNode('article') |
||||
77 | ->addDefaultsIfNotSet() |
||||
78 | ->children() |
||||
79 | ->variableNode('options')->end() |
||||
80 | ->arrayNode('classes') |
||||
0 ignored issues
–
show
The method
arrayNode() does not exist on Symfony\Component\Config...der\NodeParentInterface . It seems like you code against a sub-type of Symfony\Component\Config...der\NodeParentInterface such as Symfony\Component\Config...ion\Builder\NodeBuilder .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
81 | ->addDefaultsIfNotSet() |
||||
82 | ->children() |
||||
83 | ->scalarNode('model')->defaultValue(Article::class)->cannotBeEmpty()->end() |
||||
84 | ->scalarNode('interface')->defaultValue(ArticleInterface::class)->cannotBeEmpty()->end() |
||||
85 | ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() |
||||
86 | ->scalarNode('repository')->defaultValue(ArticleRepository::class)->cannotBeEmpty()->end() |
||||
87 | ->scalarNode('factory')->defaultValue(TranslatableFactory::class)->end() |
||||
88 | ->scalarNode('form')->defaultValue(ArticleType::class)->cannotBeEmpty()->end() |
||||
89 | ->end() |
||||
90 | ->end() |
||||
91 | ->arrayNode('translation') |
||||
92 | ->addDefaultsIfNotSet() |
||||
93 | ->children() |
||||
94 | ->variableNode('options')->end() |
||||
95 | ->arrayNode('classes') |
||||
96 | ->addDefaultsIfNotSet() |
||||
97 | ->children() |
||||
98 | ->scalarNode('model')->defaultValue(ArticleTranslation::class)->cannotBeEmpty()->end() |
||||
99 | ->scalarNode('interface')->defaultValue(ArticleTranslationInterface::class)->cannotBeEmpty()->end() |
||||
100 | ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() |
||||
101 | ->scalarNode('repository')->cannotBeEmpty()->end() |
||||
102 | ->scalarNode('factory')->defaultValue(Factory::class)->end() |
||||
103 | ->scalarNode('form')->defaultValue(ArticleTranslationType::class)->cannotBeEmpty()->end() |
||||
104 | ->end() |
||||
105 | ->end() |
||||
106 | ->end() |
||||
107 | ->end() |
||||
108 | ->end() |
||||
109 | ->end() |
||||
110 | ->arrayNode('article_category') |
||||
111 | ->addDefaultsIfNotSet() |
||||
112 | ->children() |
||||
113 | ->variableNode('options')->end() |
||||
114 | ->arrayNode('classes') |
||||
115 | ->addDefaultsIfNotSet() |
||||
116 | ->children() |
||||
117 | ->scalarNode('model')->defaultValue(ArticleCategory::class)->cannotBeEmpty()->end() |
||||
118 | ->scalarNode('interface')->defaultValue(ArticleCategoryInterface::class)->cannotBeEmpty()->end() |
||||
119 | ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() |
||||
120 | ->scalarNode('repository')->defaultValue(ArticleCategoryRepository::class)->cannotBeEmpty()->end() |
||||
121 | ->scalarNode('factory')->defaultValue(TranslatableFactory::class)->end() |
||||
122 | ->scalarNode('form')->defaultValue(ArticleCategoryType::class)->cannotBeEmpty()->end() |
||||
123 | ->end() |
||||
124 | ->end() |
||||
125 | ->arrayNode('translation') |
||||
126 | ->addDefaultsIfNotSet() |
||||
127 | ->children() |
||||
128 | ->variableNode('options')->end() |
||||
129 | ->arrayNode('classes') |
||||
130 | ->addDefaultsIfNotSet() |
||||
131 | ->children() |
||||
132 | ->scalarNode('model')->defaultValue(ArticleCategoryTranslation::class)->cannotBeEmpty()->end() |
||||
133 | ->scalarNode('interface')->defaultValue(ArticleCategoryTranslationInterface::class)->cannotBeEmpty()->end() |
||||
134 | ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() |
||||
135 | ->scalarNode('repository')->cannotBeEmpty()->end() |
||||
136 | ->scalarNode('factory')->defaultValue(Factory::class)->end() |
||||
137 | ->scalarNode('form')->defaultValue(ArticleCategoryTranslationType::class)->cannotBeEmpty()->end() |
||||
138 | ->end() |
||||
139 | ->end() |
||||
140 | ->end() |
||||
141 | ->end() |
||||
142 | ->end() |
||||
143 | ->end() |
||||
144 | ->arrayNode('article_comment') |
||||
145 | ->addDefaultsIfNotSet() |
||||
146 | ->children() |
||||
147 | ->variableNode('options')->end() |
||||
148 | ->arrayNode('classes') |
||||
149 | ->addDefaultsIfNotSet() |
||||
150 | ->children() |
||||
151 | ->scalarNode('model')->defaultValue(ArticleComment::class)->cannotBeEmpty()->end() |
||||
152 | ->scalarNode('interface')->defaultValue(ArticleCommentInterface::class)->cannotBeEmpty()->end() |
||||
153 | ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() |
||||
154 | ->scalarNode('repository')->cannotBeEmpty()->end() |
||||
155 | ->scalarNode('factory')->defaultValue(ArticleCommentFactory::class)->end() |
||||
156 | ->scalarNode('form')->defaultValue(ArticleCommentType::class)->cannotBeEmpty()->end() |
||||
157 | ->end() |
||||
158 | ->end() |
||||
159 | ->end() |
||||
160 | ->end() |
||||
161 | ->arrayNode('article_image') |
||||
162 | ->addDefaultsIfNotSet() |
||||
163 | ->children() |
||||
164 | ->variableNode('options')->end() |
||||
165 | ->arrayNode('classes') |
||||
166 | ->addDefaultsIfNotSet() |
||||
167 | ->children() |
||||
168 | ->scalarNode('model')->defaultValue(ArticleImage::class)->cannotBeEmpty()->end() |
||||
169 | ->scalarNode('interface')->defaultValue(ArticleImageInterface::class)->cannotBeEmpty()->end() |
||||
170 | ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() |
||||
171 | ->scalarNode('repository')->cannotBeEmpty()->end() |
||||
172 | ->scalarNode('factory')->defaultValue(Factory::class)->end() |
||||
173 | ->scalarNode('form')->defaultValue(ArticleImageType::class)->cannotBeEmpty()->end() |
||||
174 | ->end() |
||||
175 | ->end() |
||||
176 | ->end() |
||||
177 | ->end() |
||||
178 | ->end() |
||||
179 | ->end() |
||||
180 | ->end() |
||||
181 | ; |
||||
182 | } |
||||
183 | } |
||||
184 |