Code Duplication    Length = 14-14 lines in 2 locations

bridge/doctrine-orm/lib/OrmAgent.php 1 location

@@ 177-190 (lines=14) @@
174
    /**
175
     * {@inheritdoc}
176
     */
177
    public function supports(string $class): bool
178
    {
179
        $metadataFactory = $this->entityManager->getMetadataFactory();
180
181
        $supports = false;
182
        try {
183
            $metadataFactory->getMetadataFor(ClassUtils::getRealClass($class));
184
            $supports = true;
185
        } catch (MappingException $exception) {
186
            // no metadata - class is not known to the ORM
187
        }
188
189
        return $supports;
190
    }
191
192
    /**
193
     * {@inheritdoc}

bridge/doctrine-phpcr-odm/lib/PhpcrOdmAgent.php 1 location

@@ 150-163 (lines=14) @@
147
    /**
148
     * {@inheritdoc}
149
     */
150
    public function supports(string $class): bool
151
    {
152
        $metadataFactory = $this->documentManager->getMetadataFactory();
153
154
        $supports = false;
155
        try {
156
            $metadataFactory->getMetadataFor(ClassUtils::getRealClass($class));
157
            $supports = true;
158
        } catch (MappingException $exception) {
159
            // no metadata - class is not known to phpcr-odm
160
        }
161
162
        return $supports;
163
    }
164
165
    /**
166
     * {@inheritdoc}