Code Duplication    Length = 9-10 lines in 2 locations

src/repositories/BaseRepository.php 2 locations

@@ 59-68 (lines=10) @@
56
        return implode('\\', $parts);
57
    }
58
59
    public function findAll(Specification $specification)
60
    {
61
        $query = $this->buildSelectQuery($specification);
62
        $rows = $query->createCommand($this->db)->queryAll();
63
        $rows = array_map(function ($row) use ($query) {
64
            return $query->restoreHierarchy($row);
65
        }, $rows);
66
67
        return $this->createMultiple($rows);
68
    }
69
70
    public function findOne(Specification $specification)
71
    {
@@ 70-78 (lines=9) @@
67
        return $this->createMultiple($rows);
68
    }
69
70
    public function findOne(Specification $specification)
71
    {
72
        $specification->limit(1);
73
        $query = $this->buildSelectQuery($specification);
74
        $row = $query->createCommand($this->db)->queryOne();
75
        $row = $query->restoreHierarchy($row);
76
77
        return $this->create($row);
78
    }
79
80
    protected function buildSelectQuery(Specification $specification)
81
    {