Completed
Pull Request — master (#47)
by
unknown
02:41
created

Lower::filter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 5
Bugs 0 Features 2
Metric Value
c 5
b 0
f 2
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 2
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 Lower
15
 *
16
 * @package Particle\Filter\FilterRule
17
 */
18
class Lower extends FilterRule
19
{
20
    /**
21
     * Lowercase the given value
22
     *
23
     * @param mixed $value
24
     * @return string
25
     */
26 16
    public function filter($value)
27
    {
28 16
        if ($this->encodingFormat !== null) {
29 2
            return mb_strtolower($value, $this->encodingFormat);
30
        }
31
32 14
        return mb_strtolower($value);
33
    }
34
}
35