Maskable   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 32
rs 10
ccs 10
cts 10
cp 1
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isMaskable() 0 3 2
A mask() 0 6 1
A getMaskPlaceholder() 0 3 1
A getMaskPattern() 0 3 1
1
<?php
2
3
namespace Yaro\Jarboe\Table\Fields\Traits;
4
5
trait Maskable
6
{
7
    protected $maskPattern;
8
    protected $maskPlaceholder;
9
10 2
    public function mask(string $pattern, string $placeholder = '∗')
11
    {
12 2
        $this->maskPattern = $pattern;
13 2
        $this->maskPlaceholder = $placeholder;
14
15 2
        return $this;
16
    }
17
18
    /**
19
     * @return mixed
20
     */
21 2
    public function getMaskPattern()
22
    {
23 2
        return $this->maskPattern;
24
    }
25
26
    /**
27
     * @return mixed
28
     */
29 2
    public function getMaskPlaceholder()
30
    {
31 2
        return $this->maskPlaceholder;
32
    }
33
34 3
    public function isMaskable()
35
    {
36 3
        return $this->maskPattern && $this->maskPlaceholder;
37
    }
38
}
39