RemoveEmojiCharacters::transform()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 6
rs 10
c 1
b 0
f 0
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