Completed
Push — master ( 1f7f5f...3bc145 )
by Jan-Petter
06:44
created

NoArchive::getDirective()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

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