Completed
Push — master ( 94fb66...0ffc19 )
by Marcel
01:14
created

DnsResolver   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 32
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A resolve() 0 4 1
A resolveAll() 0 4 1
A resolveInternal() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
namespace BeyondCode\LaravelWebSockets\Statistics;
4
5
use React\Promise\FulfilledPromise;
6
use React\Dns\Resolver\ResolverInterface;
7
8
class DnsResolver implements ResolverInterface
9
{
10
    private $internalIP = '127.0.0.1';
11
12
    /*
13
     * This empty constructor is needed so we don't have to setup the parent's dependencies.
14
     */
15
    public function __construct()
16
    {
17
        //
18
    }
19
20
    public function resolve($domain)
21
    {
22
        return $this->resolveInternal($domain);
23
    }
24
25
    public function resolveAll($domain, $type)
26
    {
27
        return $this->resolveInternal($domain, $type);
28
    }
29
30
    private function resolveInternal($domain, $type = null)
0 ignored issues
show
Unused Code introduced by
The parameter $domain is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
31
    {
32
        return new FulfilledPromise($this->internalIP);
33
    }
34
35
    public function __toString()
36
    {
37
        return $this->internalIP;
38
    }
39
}
40