Passed
Push — master ( 9e5a11...b08ede )
by frey
01:13 queued 11s
created

WithFingerprint   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 5
c 1
b 0
f 1
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fingerprint() 0 7 1
1
<?php
2
3
namespace Freyo\ApiGateway\Kernel\Traits;
4
5
trait WithFingerprint
6
{
7
    /**
8
     * @param array $params
9
     *
10
     * @return string
11
     */
12
    protected function fingerprint(array $params = [])
13
    {
14
        ksort($params);
15
16
        return md5(http_build_query(array_map(function ($item) {
17
            return md5($item);
18
        }, $params)));
19
    }
20
}