Code Duplication    Length = 14-14 lines in 2 locations

src/Hydrator/Processors/Factory/LooseSimpleObjectFactory.php 1 location

@@ 30-43 (lines=14) @@
27
     * @param Schema $schema
28
     * @return bool
29
     */
30
    public function supports(Schema $schema): bool
31
    {
32
        /** @var ObjectSchema $schema */
33
        if (!parent::supports($schema) || $schema->hasComplexType()) {
34
            return false;
35
        }
36
37
        if (isset($schema->getDefinition()->additionalProperties)
38
            && !$schema->getDefinition()->additionalProperties) {
39
            return false;
40
        }
41
42
        return true;
43
    }
44
45
    /**
46
     * @return int

src/Hydrator/Processors/Factory/StrictSimpleObjectFactory.php 1 location

@@ 28-41 (lines=14) @@
25
     * @param Schema $schema
26
     * @return bool
27
     */
28
    public function supports(Schema $schema): bool
29
    {
30
        /** @var ObjectSchema $schema */
31
        if (!parent::supports($schema) || $schema->hasComplexType()) {
32
            return false;
33
        }
34
35
        if (!isset($schema->getDefinition()->additionalProperties)
36
            || $schema->getDefinition()->additionalProperties) {
37
            return false;
38
        }
39
40
        return true;
41
    }
42
43
    /**
44
     * @return int