RemoveEmojiCharacters   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 16
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 6 2
1
<?php
2
3
namespace Fatindeed\EmojiHelper\Http\Middleware;
4
5
use Fatindeed\EmojiHelper\EmojiHelper;
6
7
class RemoveEmojiCharacters extends TransformsRequest
8
{
9
    /**
10
     * Transform the given value.
11
     *
12
     * @param string $key   Input key.
13
     * @param mixed  $value Input value.
14
     *
15
     * @return mixed
16
     */
17
    protected function transform($key, $value)
18
    {
19
        if (is_string($value)) {
20
            return EmojiHelper::filter($value);
21
        } else {
22
            return $value;
23
        }
24
    }
25
}
26