1 | <?php |
||
18 | trait RouteConstructorTrait |
||
19 | { |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $path; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $spec; |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | * @see \WebinoConfigLib\Router\Route\Regex\RouteConstructorInterface |
||
33 | */ |
||
34 | public function __construct($path, $spec = null) |
||
42 | |||
43 | /** |
||
44 | * @param string $path |
||
45 | * @return $this |
||
46 | */ |
||
47 | abstract protected function setPath($path); |
||
48 | |||
49 | /** |
||
50 | * @param string|null $spec |
||
51 | * @return $this |
||
52 | */ |
||
53 | abstract protected function setSpec($spec = null); |
||
54 | |||
55 | /** |
||
56 | * @param string $type Route type. |
||
57 | * @return $this |
||
58 | */ |
||
59 | abstract public function setType($type = RouteInterface::LITERAL); |
||
60 | |||
61 | /** |
||
62 | * Initialize route |
||
63 | * |
||
64 | * @return void |
||
65 | */ |
||
66 | abstract protected function init(); |
||
67 | } |
||
68 |