Code Duplication    Length = 7-7 lines in 5 locations

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

@@ 134-140 (lines=7) @@
131
            $container->setAlias($repository, $resource->getRepository());
132
        }
133
134
        if ($resource->getFactory() !== null) {
135
            if (class_exists($resource->getFactory())) {
136
                $container->setDefinition($factory, $this->createFactoryDefinition($resource));
137
            } elseif ($factory !== $resource->getFactory()) {
138
                $container->setAlias($factory, $resource->getFactory());
139
            }
140
        }
141
142
        if ($resource->getForm() !== null) {
143
            if (class_exists($resource->getForm())) {
@@ 142-148 (lines=7) @@
139
            }
140
        }
141
142
        if ($resource->getForm() !== null) {
143
            if (class_exists($resource->getForm())) {
144
                $container->setDefinition($form, $this->createFormDefinition($resource));
145
            } elseif ($form !== $resource->getForm()) {
146
                $container->setAlias($form, $resource->getForm());
147
            }
148
        }
149
150
        if ($resource->getChoiceForm() !== null) {
151
            if (class_exists($resource->getChoiceForm())) {
@@ 150-156 (lines=7) @@
147
            }
148
        }
149
150
        if ($resource->getChoiceForm() !== null) {
151
            if (class_exists($resource->getChoiceForm())) {
152
                $container->setDefinition($choiceForm, $this->createChoiceFormDefinition($resource));
153
            } elseif ($choiceForm !== $resource->getChoiceForm()) {
154
                $container->setAlias($choiceForm, $resource->getChoiceForm());
155
            }
156
        }
157
158
        if ($resource->getDomainManager() !== null) {
159
            if (class_exists($resource->getDomainManager())) {
@@ 158-164 (lines=7) @@
155
            }
156
        }
157
158
        if ($resource->getDomainManager() !== null) {
159
            if (class_exists($resource->getDomainManager())) {
160
                $container->setDefinition($domainManager, $this->createDomainManagerDefinition($resource));
161
            } elseif ($domainManager !== $resource->getDomainManager()) {
162
                $container->setAlias($domainManager, $resource->getDomainManager());
163
            }
164
        }
165
166
        if ($resource->getController() !== null) {
167
            if (class_exists($resource->getController())) {
@@ 166-172 (lines=7) @@
163
            }
164
        }
165
166
        if ($resource->getController() !== null) {
167
            if (class_exists($resource->getController())) {
168
                $container->setDefinition($controller, $this->createControllerDefinition($resource));
169
            } elseif ($controller !== $resource->getController()) {
170
                $container->setAlias($container, $resource->getController());
171
            }
172
        }
173
174
        $container->addClassResource(new \ReflectionClass($resource));
175
    }