Code Duplication    Length = 10-10 lines in 2 locations

src/Users/UserStatistics.php 2 locations

@@ 198-207 (lines=10) @@
195
    *
196
    * @return Array of statistics.
197
    */
198
    public function getStatsByTypeDesc($typeDesc)
199
    {
200
        $stats = array();
201
        foreach ($this->data as $statistic) {
202
            if ($statistic->category_type->desc == $typeDesc) {
203
                array_push($stats,$statistic);
204
            }
205
        }
206
        return $stats;
207
    }
208
209
    /**
210
    * Get Stats by Category Code.
@@ 294-303 (lines=10) @@
291
    *
292
    * @return Array of Statistics.
293
    */
294
    public function searchStatsByTypeDesc($typeDesc)
295
    {
296
        $stats = array();
297
        foreach ($this->data as $statistic) {
298
            if (preg_match("/$typeDesc/i", $statistic->category_type->desc)) {
299
                array_push($stats,$statistic);
300
            }
301
        }
302
        return $stats;
303
    }
304
305
    /**
306
    * Search Stats by Type Code.