Generic   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 46
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getDirective() 0 4 1
A getValue() 0 4 1
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