Code Duplication    Length = 22-22 lines in 2 locations

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

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