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

RouteTypes::initDefaultTypes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
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