Completed
Pull Request — master (#47)
by
unknown
09:17
created

Append   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 1
cbo 0
dl 0
loc 28
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A filter() 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-2015 Particle (http://particle-php.com)
7
 * @license   https://github.com/particle-php/Filter/blob/master/LICENSE New BSD License
8
 */
9
namespace Particle\Filter\FilterRule;
10
11
use Particle\Filter\FilterRule;
12
13
/**
14
 * Class Append
15
 *
16
 * @package Particle\Filter\FilterRule
17
 */
18
class Append extends FilterRule
19
{
20
    /**
21
     * @var string
22
     */
23
    protected $append;
24
25
    /**
26
     * Set text to append
27
     *
28
     * @param string $append
29
     */
30 4
    public function __construct($append)
31
    {
32 4
        $this->append = $append;
33 4
    }
34
35
    /**
36
     * Append the provided text to the given value
37
     *
38
     * @param mixed $value
39
     * @return string
40
     */
41 4
    public function filter($value)
42
    {
43 4
        return $value . $this->append;
44
    }
45
}
46