Routing   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 6
dl 0
loc 30
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A picked() 0 3 1
A classify() 0 6 2
A release() 0 2 1
1
<?php
2
/**
3
 * Transport comm nodes classify
4
 * User: moyo
5
 * Date: 2018/7/31
6
 * Time: 6:36 PM
7
 */
8
9
namespace Carno\HRPC\Accel;
10
11
use Carno\Cluster\Routing\Typed;
12
use Carno\HRPC\Accel\Contracts\Named;
13
use Carno\HRPC\Client\Contracts\Defined;
0 ignored issues
show
Bug introduced by
The type Carno\HRPC\Client\Contracts\Defined was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Carno\Net\Endpoint;
15
16
class Routing implements Typed
17
{
18
    /**
19
     * @param string ...$tags
20
     * @return array
21
     */
22
    public function picked(string ...$tags) : array
23
    {
24
        return [];
25
    }
26
27
    /**
28
     * @param string $tag
29
     * @param Endpoint $node
30
     */
31
    public function classify(string $tag, Endpoint $node) : void
32
    {
33
        if ($port = Marking::commTCP($tag)) {
34
            $node->setOptions([
35
                Defined::HJ_CLIENT => Client::class,
36
                Named::VIA_TCP => $port,
37
            ]);
38
        }
39
    }
40
41
    /**
42
     * @param Endpoint $node
43
     */
44
    public function release(Endpoint $node) : void
45
    {
46
        // do nothing
47
    }
48
}
49