Code Duplication    Length = 6-6 lines in 2 locations

vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php 1 location

@@ 465-470 (lines=6) @@
462
463
        $table = $this->junction();
464
        $hasMany = $this->source()->association($table->alias());
465
        if ($this->_cascadeCallbacks) {
466
            foreach ($hasMany->find('all')->where($conditions)->toList() as $related) {
467
                $table->delete($related, $options);
468
            }
469
            return true;
470
        }
471
472
        $conditions = array_merge($conditions, $hasMany->conditions());
473
        return $table->deleteAll($conditions);

vendor/cakephp/cakephp/src/ORM/Association/DependentDeleteTrait.php 1 location

@@ 46-51 (lines=6) @@
43
        $bindingKey = (array)$this->bindingKey();
44
        $conditions = array_combine($foreignKey, $entity->extract($bindingKey));
45
46
        if ($this->_cascadeCallbacks) {
47
            foreach ($this->find()->where($conditions)->toList() as $related) {
48
                $table->delete($related, $options);
49
            }
50
            return true;
51
        }
52
53
        $conditions = array_merge($conditions, $this->conditions());
54
        return $table->deleteAll($conditions);