Completed
Push — master ( 369737...64c6ea )
by Alex
07:19
created

RouteTypes   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 20
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A initDefaultTypes() 0 7 1
1
<?php
2
namespace Mezon\Router;
3
4
/**
5
 * Default types for router - integer, string, command, list if ids
6
 *
7
 * @author gdever
8
 */
9
trait RouteTypes
10
{
11
12
    /**
13
     * Supported types of URL parameters
14
     *
15
     * @var array
16
     */
17
    private $types = [];
18
19
    /**
20
     * Init types
21
     */
22
    private function initDefaultTypes(): void
23
    {
24
        $this->types['i'] = '\Mezon\Router\Types\IntegerRouterType';
25
        $this->types['a'] = '\Mezon\Router\Types\CommandRouterType';
26
        $this->types['il'] = '\Mezon\Router\Types\IntegerListRouterType';
27
        $this->types['s'] = '\Mezon\Router\Types\StringRouterType';
28
        $this->types['fp'] = '\Mezon\Router\Types\FixPointNumberRouterType';
29
    }
30
}
31