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

WithFingerprint::fingerprint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 7
rs 10
cc 1
nc 1
nop 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
}