Code Duplication    Length = 13-13 lines in 2 locations

src/Entity/Relations.php 2 locations

@@ 93-105 (lines=13) @@
90
     * @param string $relation
91
     * @param Entity[] $entities
92
     */
93
    public function addRelated($relation, array $entities)
94
    {
95
        // @codeCoverageIgnoreStart
96
        if (func_num_args() === 3 && func_get_arg(2) instanceof EM) {
97
            trigger_error(
98
                'Passing EntityManager to addRelated is deprecated. Use ->setEntityManager() to overwrite',
99
                E_USER_DEPRECATED
100
            );
101
        }
102
        // @codeCoverageIgnoreEnd
103
104
        $this::getRelation($relation)->addRelated($this, $entities, $this->entityManager);
105
    }
106
107
    /**
108
     * Delete relations for $relation to $entities
@@ 115-127 (lines=13) @@
112
     * @param string $relation
113
     * @param Entity[] $entities
114
     */
115
    public function deleteRelated($relation, $entities)
116
    {
117
        // @codeCoverageIgnoreStart
118
        if (func_num_args() === 3 && func_get_arg(2) instanceof EM) {
119
            trigger_error(
120
                'Passing EntityManager to deleteRelated is deprecated. Use ->setEntityManager() to overwrite',
121
                E_USER_DEPRECATED
122
            );
123
        }
124
        // @codeCoverageIgnoreEnd
125
126
        $this::getRelation($relation)->deleteRelated($this, $entities, $this->entityManager);
127
    }
128
129
    /**
130
     * Fetches related objects