1 | <?php |
||
12 | class Module extends Route |
||
13 | { |
||
14 | /** |
||
15 | * A map of regular expression pattern substitutions to apply to every |
||
16 | * pattern encountered, as a means fo pre-processing patterns. Provides a |
||
17 | * useful means of adding your own custom patterns for convenient reuse. |
||
18 | * |
||
19 | * @var Closure[] map where full regular expression => substitution closure |
||
20 | * |
||
21 | * @see $symbols |
||
22 | * @see preparePattern() |
||
23 | * @see init() |
||
24 | */ |
||
25 | public $substitutions = array(); |
||
26 | |||
27 | /** |
||
28 | * Symbols used by the built-in standard substitution pattern, which provides |
||
29 | * a convenient short-hand syntax for placeholder tokens. The built-in standard |
||
30 | * symbols are: |
||
31 | * |
||
32 | * <pre> |
||
33 | * 'int' => '\d+' |
||
34 | * 'slug' => '[a-z0-9-]+' |
||
35 | * </pre> |
||
36 | * |
||
37 | * Which provides support for simplified named routes, such as: |
||
38 | * |
||
39 | * <pre> |
||
40 | * 'user/<user_id:int>' |
||
41 | * 'tags/<tag:slug>' |
||
42 | * </pre> |
||
43 | * |
||
44 | * For which the resulting patterns would be: |
||
45 | * |
||
46 | * <pre> |
||
47 | * 'user/(?<user_id:\d+>)' |
||
48 | * 'tags/(?<slug:[a-z0-9-]>)' |
||
49 | * </pre> |
||
50 | * |
||
51 | * @var string[] map where symbol name => partial regular expression |
||
52 | * |
||
53 | * @see init() |
||
54 | */ |
||
55 | public $symbols = array(); |
||
56 | |||
57 | /** |
||
58 | * @var Closure|null event-handler for diagnostic messages |
||
59 | */ |
||
60 | public $onLog = null; |
||
61 | |||
62 | /** |
||
63 | * @var InvokerInterface |
||
64 | */ |
||
65 | public $invoker; |
||
66 | |||
67 | /** |
||
68 | * @param InvokerInterface|null $invoker optional custom invoker |
||
69 | */ |
||
70 | 1 | public function __construct(InvokerInterface $invoker = null) |
|
77 | |||
78 | /** |
||
79 | * Prepares a regular expression pattern by applying the patterns and callbacks |
||
80 | * defined by {@link $substitutions} to it. |
||
81 | * |
||
82 | * @param string $pattern unprocessed pattern |
||
83 | * |
||
84 | * @return string pre-processed pattern |
||
85 | * |
||
86 | * @throws RoutingException if the regular expression fails to execute |
||
87 | */ |
||
88 | 1 | public function preparePattern($pattern) |
|
100 | |||
101 | /** |
||
102 | * Initialize the Module upon construction - override as needed. |
||
103 | */ |
||
104 | 1 | protected function init() |
|
128 | |||
129 | /** |
||
130 | * @return InvokerInterface |
||
131 | */ |
||
132 | 1 | protected function createDefaultInvoker() |
|
136 | } |
||
137 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..