Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 142-155 (lines=14) @@
139
    /**
140
     * {@inheritdoc}
141
     */
142
    public function supports(string $class): bool
143
    {
144
        $metadataFactory = $this->documentManager->getMetadataFactory();
145
146
        $supports = false;
147
        try {
148
            $metadataFactory->getMetadataFor(ClassUtils::getRealClass($class));
149
            $supports = true;
150
        } catch (MappingException $exception) {
151
            // no metadata - class is not known to phpcr-odm
152
        }
153
154
        return $supports;
155
    }
156
157
    /**
158
     * {@inheritdoc}

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

@@ 160-173 (lines=14) @@
157
    /**
158
     * {@inheritdoc}
159
     */
160
    public function supports(string $class): bool
161
    {
162
        $metadataFactory = $this->entityManager->getMetadataFactory();
163
164
        $supports = false;
165
        try {
166
            $metadataFactory->getMetadataFor(ClassUtils::getRealClass($class));
167
            $supports = true;
168
        } catch (MappingException $exception) {
169
            // no metadata - class is not known to the ORM
170
        }
171
172
        return $supports;
173
    }
174
175
    /**
176
     * {@inheritdoc}