Completed
Push — master ( 902e66...0cbd7a )
by Jan-Petter
02:44
created

InlineHostParser::render()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 9
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 9
loc 9
rs 9.6666
cc 2
eloc 6
nc 2
nop 0
1
<?php
2
namespace vipnytt\RobotsTxtParser\Parser\Directives;
3
4
use vipnytt\RobotsTxtParser\Client\Directives\InlineHostClient;
5
6
/**
7
 * Class InlineHostParser
8
 *
9
 * @package vipnytt\RobotsTxtParser\Parser\Directives
10
 */
11
class InlineHostParser extends HostParserCore
12
{
13
    /**
14
     * InlineHostParser constructor.
15
     *
16
     * @param string $base
17
     * @param string $effective
18
     */
19
    public function __construct($base, $effective)
20
    {
21
        parent::__construct($base, $effective);
22
    }
23
24
    /**
25
     * Client
26
     *
27
     * @return InlineHostClient
28
     */
29
    public function client()
30
    {
31
        return new InlineHostClient($this->base, $this->effective, $this->host);
32
    }
33
34
    /**
35
     * Render
36
     *
37
     * @return string[]
38
     */
39 View Code Duplication
    public function render()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
40
    {
41
        $result = [];
42
        foreach ($this->host as $host) {
43
            $result[] = self::DIRECTIVE_HOST . ':' . $host;
44
        }
45
        sort($result);
46
        return $result;
47
    }
48
}
49