Code Duplication    Length = 8-8 lines in 2 locations

src/voku/db/Result.php 2 locations

@@ 500-507 (lines=8) @@
497
    if (\is_object($class)) {
498
499
      /** @noinspection PhpAssignmentInConditionInspection */
500
      while ($row = $this->fetch_assoc()) {
501
        $classTmp = clone $class;
502
        $row = $this->cast($row);
503
        foreach ($row as $key => $value) {
504
          $propertyAccessor->setValue($classTmp, $key, $value);
505
        }
506
        $data[] = $classTmp;
507
      }
508
509
    } else if ($class && $params) {
510
@@ 580-587 (lines=8) @@
577
578
    if (\is_object($class)) {
579
      /** @noinspection PhpAssignmentInConditionInspection */
580
      while ($row = $this->fetch_assoc()) {
581
        $classTmp = clone $class;
582
        $row = $this->cast($row);
583
        foreach ($row as $key => $value) {
584
          $propertyAccessor->setValue($classTmp, $key, $value);
585
        }
586
        yield $classTmp;
587
      }
588
589
      return;
590
    }