Test Failed
Branch v4.x (b7bab7)
by Dmitry
09:55
created

get_param_names()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 1
dl 0
loc 13
rs 10
c 0
b 0
f 0
ccs 0
cts 6
cp 0
crap 6
1
<?php
2
3
namespace Gladyshev\Yandex\Direct;
4
5
/**
6
 * @param string $method
7
 * @return array
8
 * @throws \ReflectionException
9
 */
10
function get_param_names(string $method): array
11
{
12
    [$class, $method] = explode('::', $method);
13
14
    $refParams = (new \ReflectionMethod($class, $method))->getParameters();
15
16
    $paramNames = [];
17
18
    foreach ($refParams as $parameter) {
19
        $paramNames[] = $parameter->name;
20
    }
21
22
    return $paramNames;
23
}
24