Conditions | 3 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
37 | 54 | public static function parse($name, $config): ?Method |
|
38 | { |
||
39 | 54 | assert(in_array($name, [self::LIST, self::POST, self::GET, self::PUT, self::DELETE])); |
|
40 | 54 | assert(is_string($name)); |
|
41 | |||
42 | 54 | $method = new Method(); |
|
43 | 54 | $method->name = $name; |
|
44 | 54 | if (is_bool($config) && true === $config) { |
|
45 | 30 | return $method; |
|
46 | } |
||
47 | |||
48 | 54 | $method->right = Right::parse($config['right'] ?? null); |
|
49 | 54 | $method->defaultIncludes = ParseUtils::parseStringArray($config['defaultIncludes'] ?? null); |
|
50 | |||
51 | 54 | return $method; |
|
52 | } |
||
53 | } |
||
54 |