Completed
Push — master ( 15f476...52f8b5 )
by Alex
07:26
created

CommandRouterType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 2
1
<?php
2
namespace Mezon\Router\Types;
3
4
/**
5
 * Default command type for router
6
 *
7
 * @author gdever
8
 */
9
class CommandRouterType
10
{
11
12
    /**
13
     * Method handles command type
14
     *
15
     * @param string $value
16
     *            value to be parsed
17
     * @return bool was the value parsed
18
     */
19
    public static function handle(string &$value): bool
20
    {
21
        if (preg_match('/^([a-z0-9A-Z_\/\-\.\@]+)$/', $value)) {
22
            return true;
23
        }
24
25
        return false;
26
    }
27
}
28