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/ObjectHydrator.php 1 location

@@ 157-171 (lines=15) @@
154
    /**
155
     * {@inheritdoc}
156
     */
157
    protected function hydrateAllData()
158
    {
159
        $result = [];
160
161
        while ($row = $this->_stmt->fetch(PDO::FETCH_ASSOC)) {
162
            $this->hydrateRowData($row, $result);
163
        }
164
165
        // Take snapshots from all newly initialized collections
166
        foreach ($this->initializedCollections as $coll) {
167
            $coll->takeSnapshot();
168
        }
169
170
        return $result;
171
    }
172
173
    /**
174
     * Initializes a related collection.

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

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