Code Duplication    Length = 8-8 lines in 2 locations

source/Spiral/ODM/Entities/Compositor.php 1 location

@@ 784-791 (lines=8) @@
781
    /**
782
     * @return null|ContainerInterface
783
     */
784
    protected function container()
785
    {
786
        if (!empty($this->parent) && $this->parent instanceof Component) {
787
            return $this->parent->container();
788
        }
789
790
        return parent::container();
791
    }
792
793
    /**
794
     * Validate every composited document.

source/Spiral/ODM/DocumentEntity.php 1 location

@@ 644-651 (lines=8) @@
641
    /**
642
     * {@inheritdoc}
643
     */
644
    protected function container()
645
    {
646
        if (empty($this->odm) || !$this->odm instanceof Component) {
647
            return parent::container();
648
        }
649
650
        return $this->odm->container();
651
    }
652
653
    /**
654
     * Create document entity using given ODM instance or load parent ODM via shared container.