Code Duplication    Length = 11-13 lines in 2 locations

src/Collection/LazyModelCollection.php 1 location

@@ 139-151 (lines=13) @@
136
    /**
137
     * @return ModelInterface[]|array
138
     */
139
    public function removeFromPersistence(): array
140
    {
141
        $this->loadModels();
142
143
        $removeFromPersistenceModels = [];
144
        foreach ($this->initialModels as $initialModel) {
145
            if (!isset($this->models[$initialModel->getId()])) {
146
                $removeFromPersistenceModels[$initialModel->getId()] = $initialModel;
147
            }
148
        }
149
150
        return $removeFromPersistenceModels;
151
    }
152
153
    /**
154
     * @return array

src/Collection/ModelCollection.php 1 location

@@ 109-119 (lines=11) @@
106
    /**
107
     * @return ModelInterface[]|array
108
     */
109
    public function removeFromPersistence(): array
110
    {
111
        $removeFromPersistenceModels = [];
112
        foreach ($this->initialModels as $initialModel) {
113
            if (!isset($this->models[$initialModel->getId()])) {
114
                $removeFromPersistenceModels[$initialModel->getId()] = $initialModel;
115
            }
116
        }
117
118
        return $removeFromPersistenceModels;
119
    }
120
121
    /**
122
     * @return array