ParameterHasher::hashParameters()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProxyManager\Inflector\Util;
6
7
use function md5;
8
use function serialize;
9
10
/**
11
 * Converts given parameters into a likely unique hash
12
 */
13
class ParameterHasher
14
{
15
    /**
16
     * Converts the given parameters into a likely-unique hash
17
     *
18
     * @param mixed[] $parameters
19
     */
20
    public function hashParameters(array $parameters) : string
21 8
    {
22
        return md5(serialize($parameters));
23 8
    }
24
}
25