Code Duplication    Length = 13-13 lines in 2 locations

src/ConfigurationFactory.php 2 locations

@@ 137-149 (lines=13) @@
134
     * @param array $mappingConfig
135
     * @return \Fabiang\DoctrineDynamic\Configuration\Mapping\OneToOne
136
     */
137
    private function configureOneToOne(array $mappingConfig)
138
    {
139
        $oneToOne = new Configuration\Mapping\OneToOne;
140
        $oneToOne->setTargetEntity($this->getOption($mappingConfig, 'targetEntity', true));
141
        $oneToOne->setInversedBy($this->getOption($mappingConfig, 'inversedBy'));
142
        $oneToOne->setMappedBy($this->getOption($mappingConfig, 'mappedBy'));
143
144
        if (isset($mappingConfig['joinColumns'])) {
145
            $oneToOne->setJoinColumn($this->configureJoinColumn($mappingConfig['joinColumns']));
146
        }
147
148
        return $oneToOne;
149
    }
150
151
    private function configureManyToOne(array $mappingConfig)
152
    {
@@ 172-184 (lines=13) @@
169
        return $oneToMany;
170
    }
171
172
    private function configureManyToMany(array $mappingConfig)
173
    {
174
        $manyToMany = new Configuration\Mapping\ManyToMany;
175
        $manyToMany->setTargetEntity($this->getOption($mappingConfig, 'targetEntity', true));
176
        $manyToMany->setInversedBy($this->getOption($mappingConfig, 'inversedBy'));
177
        $manyToMany->setMappedBy($this->getOption($mappingConfig, 'mappedBy'));
178
179
        if (isset($mappingConfig['joinTable'])) {
180
            $manyToMany->setJoinTable($this->configureJoinTable($mappingConfig['joinTable']));
181
        }
182
183
        return $manyToMany;
184
    }
185
186
    /**
187
     * @param array $joinColumnConfig