Code Duplication    Length = 22-22 lines in 2 locations

lib/Doctrine/ODM/MongoDB/Tools/DocumentGenerator.php 2 locations

@@ 438-459 (lines=22) @@
435
        }
436
    }
437
438
    private function hasProperty($property, ClassMetadataInfo $metadata)
439
    {
440
        if ($this->extendsClass() || class_exists($metadata->name)) {
441
            // don't generate property if its already on the base class.
442
            $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);
443
444
            if ($reflClass->hasProperty($property)) {
445
                return true;
446
            }
447
        }
448
449
        foreach ($this->getTraits($metadata) as $trait) {
450
            if ($trait->hasProperty($property)) {
451
                return true;
452
            }
453
        }
454
455
        return (
456
            isset($this->staticReflection[$metadata->name]) &&
457
            in_array($property, $this->staticReflection[$metadata->name]['properties'])
458
        );
459
    }
460
461
    private function hasMethod($method, ClassMetadataInfo $metadata)
462
    {
@@ 461-482 (lines=22) @@
458
        );
459
    }
460
461
    private function hasMethod($method, ClassMetadataInfo $metadata)
462
    {
463
        if ($this->extendsClass() || class_exists($metadata->name)) {
464
            // don't generate method if its already on the base class.
465
            $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);
466
467
            if ($reflClass->hasMethod($method)) {
468
                return true;
469
            }
470
        }
471
472
        foreach ($this->getTraits($metadata) as $trait) {
473
            if ($trait->hasMethod($method)) {
474
                return true;
475
            }
476
        }
477
478
        return (
479
            isset($this->staticReflection[$metadata->name]) &&
480
            in_array($method, $this->staticReflection[$metadata->name]['methods'])
481
        );
482
    }
483
484
    private function hasNamespace(ClassMetadataInfo $metadata)
485
    {