1 | <?php |
||
16 | class HookDefinition { |
||
17 | |||
18 | protected $names; |
||
19 | protected $parameters; |
||
20 | protected $defaultParameters; |
||
21 | |||
22 | /** |
||
23 | * @since 1.0 |
||
24 | * |
||
25 | * @param string|string[] $names |
||
26 | * The name or the names of your parser hook. |
||
27 | * |
||
28 | * @param ParamDefinition[] $parameters |
||
29 | * The definitions of the parameters your parser hook accepts. |
||
30 | * For more information on ParamDefinition, see the ParamProcessor |
||
31 | * documentation at https://github.com/JeroenDeDauw/ParamProcessor |
||
32 | * |
||
33 | * @param string|string[] $defaultParameters |
||
34 | * An ordered list of parameter names, denoting which parameters are the defaults. |
||
35 | * If the user specifies a value without indicating the parameter name, the |
||
36 | * first default parameter is used. |
||
37 | * |
||
38 | * @throws InvalidArgumentException |
||
39 | */ |
||
40 | 19 | public function __construct( $names, array $parameters = [], $defaultParameters = [] ) { |
|
45 | |||
46 | 19 | protected function setNames( $names ) { |
|
53 | |||
54 | 16 | protected function setDefaultParams( $defaultParameters ) { |
|
57 | |||
58 | 19 | protected function getStringList( $strings ) { |
|
69 | |||
70 | 18 | protected function assertAreStrings( array $strings ) { |
|
77 | |||
78 | /** |
||
79 | * Returns the names of the hook. This returned |
||
80 | * array contains at least one name. |
||
81 | * |
||
82 | * @since 1.0 |
||
83 | * |
||
84 | * @return string[] |
||
85 | */ |
||
86 | 7 | public function getNames() { |
|
89 | |||
90 | /** |
||
91 | * Returns the definitions of the parameters that the hook accepts. |
||
92 | * |
||
93 | * @since 1.0 |
||
94 | * |
||
95 | * @return ParamDefinition[] |
||
96 | */ |
||
97 | 2 | public function getParameters() { |
|
100 | |||
101 | /** |
||
102 | * Returns an ordered list of parameter names for parameters |
||
103 | * that can be provided without specifying a name. The first |
||
104 | * parameter in the list is the one to be used for the first |
||
105 | * unnamed parameter encountered. |
||
106 | * |
||
107 | * @since 1.0 |
||
108 | * |
||
109 | * @return string[] |
||
110 | */ |
||
111 | 7 | public function getDefaultParameters() { |
|
114 | |||
115 | } |
||
116 |