1 | <?php |
||
13 | abstract class Route implements GeneratesCode |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * Compiler for stub file. |
||
18 | * |
||
19 | * @var StubFileCompiler |
||
20 | */ |
||
21 | protected $compiler; |
||
22 | |||
23 | /** |
||
24 | * Compiler for stub file. |
||
25 | * |
||
26 | * @var Filesystem |
||
27 | */ |
||
28 | protected $filesystem; |
||
29 | |||
30 | /** |
||
31 | * Replacements. |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $replacements; |
||
36 | |||
37 | /** |
||
38 | * Route constructor. |
||
39 | * |
||
40 | * @param StubFileCompiler $compiler |
||
41 | * @param Filesystem $filesystem |
||
42 | */ |
||
43 | public function __construct(StubFileCompiler $compiler, Filesystem $filesystem) |
||
48 | |||
49 | /** |
||
50 | * @return array |
||
51 | */ |
||
52 | public function getReplacements() |
||
56 | |||
57 | /** |
||
58 | * @param array $replacements |
||
59 | */ |
||
60 | public function setReplacements($replacements) |
||
64 | |||
65 | /** |
||
66 | * Generate route code. |
||
67 | */ |
||
68 | public function code() |
||
75 | |||
76 | /** |
||
77 | * Get stub path. |
||
78 | * |
||
79 | * @return mixed |
||
80 | */ |
||
81 | abstract protected function getStubPath(); |
||
82 | |||
83 | /** |
||
84 | * Obtain replacements for stub. |
||
85 | * |
||
86 | * @return mixed |
||
87 | */ |
||
88 | abstract protected function obtainReplacements(); |
||
89 | |||
90 | } |
||
91 |