Completed
Push — master ( d5c9e6...77b81f )
by Konstantin
02:19
created

AbstractFormHelper::get()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
nc 1
1
<?php
2
3
namespace FormHelper;
4
5
abstract class AbstractFormHelper
6
{
7
    public abstract function set($data);
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
8
    public abstract function get();
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
9
10 2
    public function isCyrillic($word)
11
    {
12 2
        return (bool) preg_match("/[\p{Cyrillic}]/ui", $word);
13
    }
14
15 2
    public function isLatin($word)
16
    {
17 2
        return (bool) preg_match("/[\p{Latin}]/ui", $word);
18
    }
19
20 4
    public function isText($word)
21
    {
22 4
        return (bool) preg_match("/(\p{Latin}+|[\p{Cyrillic}]+)$/u", $word);
23
    }
24
25 2
    public function isInteger($digit)
26
    {
27 2
        return preg_match("/^\d+$/", $digit);
28
    }
29
}