Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
Width | |
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
4 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
set | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
full | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
half | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | /** |
4 | * @license MIT |
5 | * @author hazuki3417<hazuki3417@gmail.com> |
6 | * @copyright 2021 hazuki3417 all rights reserved. |
7 | */ |
8 | |
9 | namespace Selen\Str\Verify; |
10 | |
11 | use Selen\Str\Verify\Width\Full; |
12 | use Selen\Str\Verify\Width\Half; |
13 | |
14 | class Width |
15 | { |
16 | /** @var string 検証対象の文字列 */ |
17 | private string $str; |
18 | |
19 | private function __construct(string $val) |
20 | { |
21 | $this->str = $val; |
22 | } |
23 | |
24 | public static function set(string $val): Width |
25 | { |
26 | return new self($val); |
27 | } |
28 | |
29 | public function full(): Full |
30 | { |
31 | return Full::set($this->str); |
32 | } |
33 | |
34 | public function half(): Half |
35 | { |
36 | return Half::set($this->str); |
37 | } |
38 | } |