Code Duplication    Length = 10-10 lines in 2 locations

src/Users/UserStatistics.php 2 locations

@@ 214-223 (lines=10) @@
211
    *
212
    * @return Array of Statistics.
213
    */
214
    public function getStatsByCategoryCode($categoryCode)
215
    {
216
        $stats = array();
217
        foreach ($this->data as $statistic) {
218
            if ($statistic->statistic_category->value == $categoryCode) {
219
                array_push($stats,$statistic);
220
            }
221
        }
222
        return $stats;
223
    }
224
225
    /**
226
    * Get Stats by Category Desc.
@@ 310-319 (lines=10) @@
307
    *
308
    * @return Array of Statistics.
309
    */
310
    public function searchStatsByCategoryCode($categoryCode)
311
    {
312
        $stats = array();
313
        foreach ($this->data as $statistic) {
314
            if (preg_match("/$categoryCode/i", $statistic->statistic_category->value)) {
315
                array_push($stats,$statistic);
316
            }
317
        }
318
        return $stats;
319
    }
320
321
    /**
322
    * Search Stats by Type Code.