Code Duplication    Length = 20-20 lines in 2 locations

src/voku/db/Result.php 2 locations

@@ 308-327 (lines=20) @@
305
   *
306
   * @return array
307
   */
308
  public function fetchAllArray(): array
309
  {
310
    // init
311
    $data = [];
312
313
    if (
314
        $this->_result
315
        &&
316
        !$this->is_empty()
317
    ) {
318
      $this->reset();
319
320
      /** @noinspection PhpAssignmentInConditionInspection */
321
      while ($row = \mysqli_fetch_assoc($this->_result)) {
322
        $data[] = $this->cast($row);
323
      }
324
    }
325
326
    return $data;
327
  }
328
329
  /**
330
   * Fetch all results as "Arrayy"-object.
@@ 334-353 (lines=20) @@
331
   *
332
   * @return Arrayy
333
   */
334
  public function fetchAllArrayy(): Arrayy
335
  {
336
    // init
337
    $data = [];
338
339
    if (
340
        $this->_result
341
        &&
342
        !$this->is_empty()
343
    ) {
344
      $this->reset();
345
346
      /** @noinspection PhpAssignmentInConditionInspection */
347
      while ($row = \mysqli_fetch_assoc($this->_result)) {
348
        $data[] = $this->cast($row);
349
      }
350
    }
351
352
    return Arrayy::create($data);
353
  }
354
355
  /**
356
   * Fetch a single column as an 1-dimension array.