Code Duplication    Length = 20-20 lines in 2 locations

src/voku/db/Result.php 2 locations

@@ 185-204 (lines=20) @@
182
   *
183
   * @return array
184
   */
185
  public function fetchAllArray()
186
  {
187
    // init
188
    $data = array();
189
190
    if (
191
        $this->_result
192
        &&
193
        !$this->is_empty()
194
    ) {
195
      $this->reset();
196
197
      /** @noinspection PhpAssignmentInConditionInspection */
198
      while ($row = \mysqli_fetch_assoc($this->_result)) {
199
        $data[] = $this->cast($row);
200
      }
201
    }
202
203
    return $data;
204
  }
205
206
  /**
207
   * Fetch all results as "Arrayy"-object.
@@ 211-230 (lines=20) @@
208
   *
209
   * @return Arrayy
210
   */
211
  public function fetchAllArrayy()
212
  {
213
    // init
214
    $data = array();
215
216
    if (
217
        $this->_result
218
        &&
219
        !$this->is_empty()
220
    ) {
221
      $this->reset();
222
223
      /** @noinspection PhpAssignmentInConditionInspection */
224
      while ($row = \mysqli_fetch_assoc($this->_result)) {
225
        $data[] = $this->cast($row);
226
      }
227
    }
228
229
    return Arrayy::create($data);
230
  }
231
232
  /**
233
   * Check if the result is empty.