Censor   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A censure() 0 9 2
1
<?php
2
3
namespace Common\Tool;
4
5
class Censor
6
{
7
    /**
8
     * @param mixed $value
9
     * @return string|null
10
     */
11
    public static function censure($value): ?string
12
    {
13
        if ($value === null) {
14
            return $value;
15
        }
16
17
        $string = (string)$value;
18
19
        return preg_replace('/\p{L}|\d/u', '█', $string);
20
    }
21
}
22