CommentCollection   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMergedCommentsByUserId() 0 6 1
1
<?php
2
3
namespace PhpEarth\Stats\Collection;
4
5
use PhpEarth\Stats\Collection;
6
use PhpEarth\Stats\Util\Merger;
7
8
/**
9
 * Class CommentCollection.
10
 */
11
class CommentCollection extends Collection
12
{
13
    /**
14
     * Merge comments created by the same user.
15
     *
16
     * @param int $userId
17
     *
18
     * @return array
19
     */
20
    public function getMergedCommentsByUserId($userId)
21
    {
22
        $merger = new Merger();
23
        $merger->setData($this->data);
24
25
        return $merger->getMergedItems($userId);
26
    }
27
}
28