Code Duplication    Length = 12-12 lines in 2 locations

source/Spiral/ODM/Entities/DocumentInstantiator.php 1 location

@@ 134-145 (lines=12) @@
131
     *
132
     * @return array
133
     */
134
    private function normalizeFields($fields): array
135
    {
136
        $result = [];
137
        if (!is_scalar($fields)) {
138
            //Trying to iterate over
139
            foreach ($fields as $name => $value) {
140
                $result[$name] = $value;
141
            }
142
        }
143
144
        return $result;
145
    }
146
}

source/Spiral/ORM/Entities/RecordInstantiator.php 1 location

@@ 90-101 (lines=12) @@
87
     *
88
     * @return array
89
     */
90
    private function normalizeFields($fields): array
91
    {
92
        $result = [];
93
        if (!is_scalar($fields)) {
94
            //Trying to iterate over
95
            foreach ($fields as $name => $value) {
96
                $result[$name] = $value;
97
            }
98
        }
99
100
        return $result;
101
    }
102
}