Code Duplication    Length = 10-16 lines in 5 locations

lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php 1 location

@@ 82-91 (lines=10) @@
79
    /**
80
     * {@inheritdoc}
81
     */
82
    protected function hydrateAllData()
83
    {
84
        $result = [];
85
86
        while ($data = $this->_stmt->fetch(PDO::FETCH_ASSOC)) {
87
            $this->hydrateRowData($data, $result);
88
        }
89
90
        return $result;
91
    }
92
93
    /**
94
     * {@inheritdoc}

lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php 1 location

@@ 36-45 (lines=10) @@
33
    /**
34
     * {@inheritdoc}
35
     */
36
    protected function hydrateAllData()
37
    {
38
        $result = [];
39
40
        while ($data = $this->_stmt->fetch(\PDO::FETCH_ASSOC)) {
41
            $this->hydrateRowData($data, $result);
42
        }
43
44
        return $result;
45
    }
46
47
    /**
48
     * {@inheritdoc}

lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php 1 location

@@ 63-74 (lines=12) @@
60
    /**
61
     * {@inheritdoc}
62
     */
63
    protected function hydrateAllData()
64
    {
65
        $result = [];
66
67
        while ($row = $this->_stmt->fetch(PDO::FETCH_ASSOC)) {
68
            $this->hydrateRowData($row, $result);
69
        }
70
71
        $this->_em->getUnitOfWork()->triggerEagerLoads();
72
73
        return $result;
74
    }
75
76
    /**
77
     * {@inheritdoc}

lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php 1 location

@@ 165-180 (lines=16) @@
162
     *
163
     * @return mixed
164
     */
165
    public function hydrateRow()
166
    {
167
        $row = $this->_stmt->fetch(PDO::FETCH_ASSOC);
168
169
        if ( ! $row) {
170
            $this->cleanup();
171
172
            return false;
173
        }
174
175
        $result = [];
176
177
        $this->hydrateRowData($row, $result);
178
179
        return $result;
180
    }
181
182
    /**
183
     * When executed in a hydrate() loop we have to clear internal state to

lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php 1 location

@@ 177-191 (lines=15) @@
174
    /**
175
     * {@inheritdoc}
176
     */
177
    protected function hydrateAllData()
178
    {
179
        $result = [];
180
181
        while ($row = $this->_stmt->fetch(PDO::FETCH_ASSOC)) {
182
            $this->hydrateRowData($row, $result);
183
        }
184
185
        // Take snapshots from all newly initialized collections
186
        foreach ($this->initializedCollections as $coll) {
187
            $coll->takeSnapshot();
188
        }
189
190
        return $result;
191
    }
192
193
    /**
194
     * Initializes a related collection.