Code Duplication    Length = 9-9 lines in 6 locations

src/Bundle/ResourceBundle/DependencyInjection/Extension/ResourceExtension.php 6 locations

@@ 125-133 (lines=9) @@
122
            $container->setAlias('lug.manager.'.$resource->getName(), $this->createManagerAlias($resource));
123
        }
124
125
        if ($resource->getRepository() !== null) {
126
            $repository = 'lug.repository.'.$resource->getName();
127
128
            if (class_exists($resource->getRepository())) {
129
                $container->setDefinition($repository, $this->createRepositoryDefinition($resource));
130
            } elseif ($repository !== $resource->getRepository()) {
131
                $container->setAlias($repository, $resource->getRepository());
132
            }
133
        }
134
135
        if ($resource->getFactory() !== null) {
136
            $factory = 'lug.factory.'.$resource->getName();
@@ 135-143 (lines=9) @@
132
            }
133
        }
134
135
        if ($resource->getFactory() !== null) {
136
            $factory = 'lug.factory.'.$resource->getName();
137
138
            if (class_exists($resource->getFactory())) {
139
                $container->setDefinition($factory, $this->createFactoryDefinition($resource));
140
            } elseif ($factory !== $resource->getFactory()) {
141
                $container->setAlias($factory, $resource->getFactory());
142
            }
143
        }
144
145
        if ($resource->getForm() !== null) {
146
            $form = 'lug.form.type.'.$resource->getName();
@@ 145-153 (lines=9) @@
142
            }
143
        }
144
145
        if ($resource->getForm() !== null) {
146
            $form = 'lug.form.type.'.$resource->getName();
147
148
            if (class_exists($resource->getForm())) {
149
                $container->setDefinition($form, $this->createFormDefinition($resource));
150
            } elseif ($form !== $resource->getForm()) {
151
                $container->setAlias($form, $resource->getForm());
152
            }
153
        }
154
155
        if ($resource->getChoiceForm() !== null) {
156
            $choiceForm = 'lug.form.type.'.$resource->getName().'.choice';
@@ 155-163 (lines=9) @@
152
            }
153
        }
154
155
        if ($resource->getChoiceForm() !== null) {
156
            $choiceForm = 'lug.form.type.'.$resource->getName().'.choice';
157
158
            if (class_exists($resource->getChoiceForm())) {
159
                $container->setDefinition($choiceForm, $this->createChoiceFormDefinition($resource));
160
            } elseif ($choiceForm !== $resource->getChoiceForm()) {
161
                $container->setAlias($choiceForm, $resource->getChoiceForm());
162
            }
163
        }
164
165
        if ($resource->getDomainManager() !== null) {
166
            $domainManager = 'lug.domain_manager.'.$resource->getName();
@@ 165-173 (lines=9) @@
162
            }
163
        }
164
165
        if ($resource->getDomainManager() !== null) {
166
            $domainManager = 'lug.domain_manager.'.$resource->getName();
167
168
            if (class_exists($resource->getDomainManager())) {
169
                $container->setDefinition($domainManager, $this->createDomainManagerDefinition($resource));
170
            } elseif ($domainManager !== $resource->getDomainManager()) {
171
                $container->setAlias($domainManager, $resource->getDomainManager());
172
            }
173
        }
174
175
        if ($resource->getController() !== null) {
176
            $controller = 'lug.controller.'.$resource->getName();
@@ 175-183 (lines=9) @@
172
            }
173
        }
174
175
        if ($resource->getController() !== null) {
176
            $controller = 'lug.controller.'.$resource->getName();
177
178
            if (class_exists($resource->getController())) {
179
                $container->setDefinition($controller, $this->createControllerDefinition($resource));
180
            } elseif ($controller !== $resource->getController()) {
181
                $container->setAlias($container, $resource->getController());
182
            }
183
        }
184
185
        $container->addObjectResource($resource);
186
    }