InputTypeHint::method()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 3
nc 2
nop 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Marcosh\PhpTypeChecker\TypeHint;
6
7
use Roave\BetterReflection\Reflection\ReflectionFunction;
8
use Roave\BetterReflection\Reflection\ReflectionMethod;
9
10
final class InputTypeHint
11
{
12
    public static function method(ReflectionMethod $method): \Iterator
13
    {
14
        foreach ($method->getParameters() as $parameter) {
15
            yield from MethodParamTypeHint::param($parameter);
16
        }
17
    }
18
19
    public static function function(ReflectionFunction $function): \Iterator
20
    {
21
        foreach ($function->getParameters() as $parameter) {
22
            yield from FunctionParamTypeHint::param($parameter);
23
        }
24
    }
25
}
26