Passed
Push — master ( edb799...f409da )
by Petr
07:56
created

Common   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 4
1
<?php
2
3
namespace ProtocolsTests\Fsp;
4
5
6
class Common
7
{
8
    public static function makeDummyQuery(array $values)
9
    {
10
        $res = fopen('php://temp', 'rw');
11
        fputs($res, static::makeDummyString($values));
12
        rewind($res);
13
        return $res;
14
    }
15
16
    public static function makeDummyString(array $values)
17
    {
18
        return implode('', array_map(['\ProtocolsTests\Fsp\Common', 'makeDummyChars'], $values));
19
    }
20
21
    public static function makeDummyChars($input): string
22
    {
23
        return (is_int($input)) ? chr($input) : strval($input);
24
    }
25
}
26