Generic::getDirective()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace vipnytt\XRobotsTagParser\Directives;
3
4
/**
5
 * Class Generic
6
 *
7
 * @package vipnytt\XRobotsTagParser\Directives
8
 */
9
final class Generic implements DirectiveInterface
10
{
11
    /**
12
     * Directive
13
     * @param string
14
     */
15
    protected $directive;
16
17
    /**
18
     * Rule string
19
     * @param string
20
     */
21
    protected $rule;
22
23
    /**
24
     * Constructor
25
     *
26
     * @param string $directive
27
     * @param string $rule
28
     */
29
    public function __construct($directive, $rule)
30
    {
31
        $this->directive = mb_strtolower($directive);
32
        $this->rule = $rule;
33
    }
34
35
    /**
36
     * Get directive name
37
     *
38
     * @return string
39
     */
40
    public function getDirective()
41
    {
42
        return $this->directive;
43
    }
44
45
    /**
46
     * Get value
47
     *
48
     * @return true
49
     */
50
    public function getValue()
51
    {
52
        return true;
53
    }
54
}
55