Rule   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 59
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A getMessages() 0 4 1
A getParameters() 0 4 1
1
<?php
2
/**
3
 * Particle.
4
 *
5
 * @link      http://github.com/particle-php for the canonical source repository
6
 * @copyright Copyright (c) 2005-2016 Particle (http://particle-php.com)
7
 * @license   https://github.com/particle-php/validator/blob/master/LICENSE New BSD License
8
 */
9
namespace Particle\Validator\Output;
10
11
/**
12
 * The Rule class is a representation of an actual rule for displaying purposes.
13
 *
14
 * @package Particle\Validator
15
 */
16
class Rule
17
{
18
    /**
19
     * @var string
20
     */
21
    protected $name;
22
23
    /**
24
     * @var array
25
     */
26
    protected $messages;
27
28
    /**
29
     * @var array
30
     */
31
    protected $parameters;
32
33
    /**
34
     * @param string $name
35
     * @param array $messages
36
     * @param array $parameters
37
     */
38 2
    public function __construct($name, array $messages, array $parameters)
39
    {
40 2
        $this->name = $name;
41 2
        $this->messages = $messages;
42 2
        $this->parameters = $parameters;
43 2
    }
44
45
    /**
46
     * Returns the name (short class name) for this rule.
47
     *
48
     * @return string
49
     */
50 1
    public function getName()
51
    {
52 1
        return $this->name;
53
    }
54
55
    /**
56
     * Returns all messages for this rule.
57
     *
58
     * @return array
59
     */
60 1
    public function getMessages()
61
    {
62 1
        return $this->messages;
63
    }
64
65
    /**
66
     * Returns all parameters for this rule.
67
     *
68
     * @return array
69
     */
70 2
    public function getParameters()
71
    {
72 2
        return $this->parameters;
73
    }
74
}
75