Completed
Push — master ( dd07bc...4a603a )
by Jan-Petter
05:48
created

nofollow::getArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace vipnytt\XRobotsTagParser\directives;
4
5
6 View Code Duplication
final class nofollow implements directiveInterface
0 ignored issues
show
Duplication introduced by
This class 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...
7
{
8
    const DIRECTIVE = 'nofollow';
9
10
    /**
11
     * Constructor
12
     *
13
     * @param string $rule
14
     * @param array $options
15
     */
16
    public function __construct($rule, $options = [])
17
    {
18
        foreach ($options as $key => $rule) {
19
            if (isset($this->$key)) {
20
                $this->$key = $rule;
21
            }
22
        }
23
    }
24
25
    /**
26
     * Get directive name
27
     *
28
     * @return string
29
     */
30
    public function getDirective()
31
    {
32
        return self::DIRECTIVE;
33
    }
34
35
    /**
36
     * Get value
37
     *
38
     * @return bool|string|null
39
     */
40
    public function getValue()
41
    {
42
        return true;
43
    }
44
}