Labeled   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A labels() 0 5 1
1
<?php
2
/**
3
 * Metrics labeled
4
 * User: moyo
5
 * Date: 2018/5/18
6
 * Time: 10:32 AM
7
 */
8
9
namespace Carno\Monitor\Chips\Metrical;
10
11
trait Labeled
12
{
13
    /**
14
     * @var array
15
     */
16
    private $labels = [];
17
18
    /**
19
     * @var string
20
     */
21
    private $grouped = 'user';
22
23
    /**
24
     * @param array $set
25
     * @return static
26
     */
27
    public function labels(array $set) : self
28
    {
29
        $this->labels = array_merge($this->labels, $set);
30
        $this->grouped = md5(serialize($this->labels));
31
        return $this;
32
    }
33
}
34