Conditions | 6 |
Paths | 6 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 6.0703 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
35 | 3 | public static function contains( $type, $text ) { |
|
36 | |||
37 | 3 | if ( $type === ONOI_TESA_CHAR_EXAMINER_HIRAGANA_KATAKANA ) { |
|
38 | 1 | return preg_match('/[\x{3040}-\x{309F}]/u', $text ) > 0 || preg_match('/[\x{30A0}-\x{30FF}]/u', $text ) > 0; // isHiragana || isKatakana |
|
39 | } |
||
40 | |||
41 | 2 | if ( $type === ONOI_TESA_CHAR_EXAMINER_HANGUL ) { |
|
42 | 1 | return preg_match('/[\x{3130}-\x{318F}]/u', $text ) > 0 || preg_match('/[\x{AC00}-\x{D7AF}]/u', $text ) > 0; |
|
43 | } |
||
44 | |||
45 | 1 | if ( $type === ONOI_TESA_CHAR_EXAMINER_CHINESE ) { |
|
46 | 1 | return preg_match('/[\x{4e00}-\x{9fa5}]/u', $text ) > 0; |
|
47 | } |
||
48 | } |
||
49 | |||
51 |