CommentCollection::getMergedCommentsByUserId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
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