Code Duplication    Length = 10-11 lines in 2 locations

src/Users/UserStatistics.php 2 locations

@@ 158-168 (lines=11) @@
155
    *
156
    * @return Array of Statistics.
157
    */
158
    public function getStatsByTypeCode($typeCode)
159
    {
160
        $stats = array();
161
        foreach ($this->data as $statistic) {
162
            if ($statistic->category_type->value == $typeCode) {
163
                array_push($stats,$statistic);
164
            }
165
    
166
        }
167
        return $stats;
168
    } 
169
170
    /**
171
    * Get Stats by Type Desc.
@@ 255-264 (lines=10) @@
252
    *
253
    * @return Array of Statistics.
254
    */
255
    public function searchStatsByTypeCode($typeCode)
256
    {
257
        $stats = array();
258
        foreach ($this->data as $statistic) {
259
            if (preg_match("/$typeCode/i", $statistic->category_type->value)) {
260
                array_push($stats,$statistic);
261
            }
262
        }
263
        return $stats;
264
    }
265
266
    /**
267
    * Search Stats by Type Code.