CountValues   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 12
ccs 2
cts 2
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A countValues() 0 3 1
1
<?php
2
3
namespace Cocur\Chain\Link;
4
5
/**
6
 * CountValues.
7
 *
8
 * @author    Florian Eckerstorfer
9
 * @copyright 2015-2018 Florian Eckerstorfer
10
 */
11
trait CountValues
12
{
13
    /**
14
     * Counts all the values of the array.
15
     *
16
     * Returns an array using the values of the array as keys and their frequency as values.
17
     *
18
     * @return array an associative array of values from the array as keys and their count value
19
     */
20 1
    public function countValues(): array
21
    {
22 1
        return array_count_values($this->array);
23
    }
24
}
25