1 | <?php |
||
17 | abstract class MappingService { |
||
18 | |||
19 | /** |
||
20 | * The internal name of the service. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $serviceName; |
||
25 | |||
26 | /** |
||
27 | * A list of aliases for the internal name. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $aliases; |
||
32 | |||
33 | /** |
||
34 | * A list of features that support the service, used for validation and defaulting. |
||
35 | * |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $features; |
||
39 | |||
40 | /** |
||
41 | * A list of names of resource modules to add. |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $resourceModules = []; |
||
46 | |||
47 | /** |
||
48 | * A list of dependencies (header items) that have been added. |
||
49 | * |
||
50 | * @var array |
||
51 | */ |
||
52 | private $addedDependencies = []; |
||
53 | |||
54 | /** |
||
55 | * A list of dependencies (header items) that need to be added. |
||
56 | * |
||
57 | * @var array |
||
58 | */ |
||
59 | private $dependencies = []; |
||
60 | |||
61 | /** |
||
62 | * @param string $serviceName |
||
63 | * @param array $aliases |
||
64 | */ |
||
65 | public function __construct( $serviceName, array $aliases = [] ) { |
||
69 | |||
70 | /** |
||
71 | * @since 0.7 |
||
72 | * |
||
73 | * @param $parameterInfo array of IParam |
||
74 | */ |
||
75 | public function addParameterInfo( array &$parameterInfo ) { |
||
77 | |||
78 | /** |
||
79 | * @since 0.6.3 |
||
80 | */ |
||
81 | public function addFeature( $featureName, $handlingClass ) { |
||
84 | |||
85 | /** |
||
86 | * @since 5.2.0 |
||
87 | * |
||
88 | * @param ParserOutput $parserOutput |
||
89 | */ |
||
90 | public final function addDependencies( ParserOutput $parserOutput ) { |
||
100 | |||
101 | /** |
||
102 | * @since 0.6.3 |
||
103 | */ |
||
104 | public final function getDependencyHtml() { |
||
119 | |||
120 | /** |
||
121 | * Returns a list of html fragments, such as script includes, the current service depends on. |
||
122 | * |
||
123 | * @since 0.6.3 |
||
124 | * |
||
125 | * @return array |
||
126 | */ |
||
127 | protected function getDependencies() { |
||
130 | |||
131 | /** |
||
132 | * Returns the resource modules that need to be loaded to use this mapping service. |
||
133 | * |
||
134 | * @since 0.7.3 |
||
135 | * |
||
136 | * @return array of string |
||
137 | */ |
||
138 | public function getResourceModules() { |
||
141 | |||
142 | /** |
||
143 | * @since 0.6.3 |
||
144 | */ |
||
145 | public function getName() { |
||
148 | |||
149 | /** |
||
150 | * @since 0.6.6 |
||
151 | */ |
||
152 | public function getFeatureInstance( $featureName ) { |
||
161 | |||
162 | /** |
||
163 | * @since 0.6.3 |
||
164 | */ |
||
165 | public function getFeature( $featureName ) { |
||
168 | |||
169 | /** |
||
170 | * @since 0.6.3 |
||
171 | */ |
||
172 | public function getAliases() { |
||
175 | |||
176 | /** |
||
177 | * @since 0.6.3 |
||
178 | */ |
||
179 | public function hasAlias( $alias ) { |
||
182 | |||
183 | /** |
||
184 | * Add one or more names of resource modules that should be loaded. |
||
185 | * |
||
186 | * @since 0.7.3 |
||
187 | * |
||
188 | * @param mixed $modules Array of string or string |
||
189 | */ |
||
190 | public function addResourceModules( $modules ) { |
||
193 | |||
194 | /** |
||
195 | * @param array $dependencies |
||
196 | */ |
||
197 | public function addHtmlDependencies( array $dependencies ) { |
||
202 | |||
203 | /** |
||
204 | * @since 0.6.3 |
||
205 | * |
||
206 | * @param $dependencyHtml |
||
207 | */ |
||
208 | public final function addHtmlDependency( $dependencyHtml ) { |
||
211 | |||
212 | /** |
||
213 | * @since 1.0 |
||
214 | */ |
||
215 | public function getEarthZoom() { |
||
218 | |||
219 | public abstract function getMapId( $increment = true ); |
||
220 | |||
221 | } |
||
222 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: