REF::analyzing()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 2
nc 2
nop 3
1
<?php
2
/**
3
 * Service detecting via reflection
4
 * User: moyo
5
 * Date: 24/02/2018
6
 * Time: 4:16 PM
7
 */
8
9
namespace Carno\RPC\Service\SDetectors;
10
11
use Carno\RPC\Service\Router;
12
use ReflectionClass;
13
14
class REF implements API
15
{
16
    use ASS;
17
18
    /**
19
     * @return bool
20
     */
21
    public function supported() : bool
22
    {
23
        return true;
24
    }
25
26
    /**
27
     * @param Router $router
28
     * @param string $contracts
29
     * @param string $implementer
30
     */
31
    public function analyzing(Router $router, string $contracts, string $implementer) : void
32
    {
33
        foreach ((new ReflectionClass($implementer))->getInterfaces() as $inf) {
34
            $this->assigning($router, $contracts, explode('\\', $inf->getNamespaceName()));
35
        }
36
    }
37
}
38