Code Duplication    Length = 8-8 lines in 2 locations

src/AbstractDoctrineRepository.php 2 locations

@@ 66-73 (lines=8) @@
63
        $qb->select('*')->from($this->getTable())->where($qb->expr()->eq('id', ':id'))->setParameter('id', $id);
64
65
        $row = $qb->execute()->fetch(\PDO::FETCH_ASSOC);
66
        if (false === $row) {
67
            $this->logger->warning(
68
                'model: model {model} with id {id} not found',
69
                ['model' => $modelClass, 'id' => $id]
70
            );
71
72
            return null;
73
        }
74
75
        $model = $modelClass::fromRow($row);
76
@@ 100-107 (lines=8) @@
97
        $qb = $this->getFindByQueryBuilder($criteria)->setMaxResults(1);
98
99
        $row = $qb->execute()->fetch(\PDO::FETCH_ASSOC);
100
        if (false === $row) {
101
            $this->logger->warning(
102
                'model: model {model} with criteria {criteria} not found',
103
                ['model' => $modelClass, 'criteria' => $criteria]
104
            );
105
106
            return null;
107
        }
108
109
        return $modelClass::fromRow($row);
110
    }