UppercaseFilter::filter()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 2
1
<?php namespace Arcanedev\Sanitizer\Filters;
2
3
use Arcanedev\Sanitizer\Contracts\Filterable;
4
use Illuminate\Support\Str;
5
6
/**
7
 * Class     UppercaseFilter
8
 *
9
 * @package  Arcanedev\Sanitizer\Filters
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class UppercaseFilter implements Filterable
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Main Functions
16
     | ------------------------------------------------------------------------------------------------
17
     */
18
    /**
19
     * Lowercase the given string.
20
     *
21
     * @param  mixed  $value
22
     * @param  array  $options
23
     *
24
     * @return string|mixed
25
     */
26 45
    public function filter($value, array $options = [])
27
    {
28 45
        return is_string($value) ? Str::upper($value) : $value;
29
    }
30
}
31