1 | <?php |
||
12 | abstract class MapsMappingService { |
||
13 | |||
14 | /** |
||
15 | * The internal name of the service. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $serviceName; |
||
20 | |||
21 | /** |
||
22 | * A list of aliases for the internal name. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $aliases; |
||
27 | |||
28 | /** |
||
29 | * A list of features that support the service, used for validation and defaulting. |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $features; |
||
34 | |||
35 | /** |
||
36 | * A list of names of resource modules to add. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $resourceModules = []; |
||
41 | |||
42 | /** |
||
43 | * A list of dependencies (header items) that have been added. |
||
44 | * |
||
45 | * @var array |
||
46 | */ |
||
47 | private $addedDependencies = []; |
||
48 | |||
49 | /** |
||
50 | * A list of dependencies (header items) that need to be added. |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | private $dependencies = []; |
||
55 | |||
56 | /** |
||
57 | * @param string $serviceName |
||
58 | * @param array $aliases |
||
59 | */ |
||
60 | public function __construct( $serviceName, array $aliases = [] ) { |
||
64 | |||
65 | /** |
||
66 | * @since 0.7 |
||
67 | * |
||
68 | * @param $parameterInfo array of IParam |
||
69 | */ |
||
70 | public function addParameterInfo( array &$parameterInfo ) { |
||
72 | |||
73 | /** |
||
74 | * @since 0.6.3 |
||
75 | */ |
||
76 | public function addFeature( $featureName, $handlingClass ) { |
||
79 | |||
80 | /** |
||
81 | * @since 5.2.0 |
||
82 | * @param ParserOutput $parserOutput |
||
83 | */ |
||
84 | 19 | public final function addDependencies( ParserOutput $parserOutput ) { |
|
94 | |||
95 | /** |
||
96 | * @since 0.6.3 |
||
97 | */ |
||
98 | 19 | public final function getDependencyHtml() { |
|
113 | |||
114 | /** |
||
115 | * Returns a list of html fragments, such as script includes, the current service depends on. |
||
116 | * |
||
117 | * @since 0.6.3 |
||
118 | * |
||
119 | * @return array |
||
120 | */ |
||
121 | protected function getDependencies() { |
||
124 | |||
125 | /** |
||
126 | * Returns the resource modules that need to be loaded to use this mapping service. |
||
127 | * |
||
128 | * @since 0.7.3 |
||
129 | * |
||
130 | * @return array of string |
||
131 | */ |
||
132 | 19 | public function getResourceModules() { |
|
135 | |||
136 | /** |
||
137 | * @since 0.6.3 |
||
138 | */ |
||
139 | 19 | public function getName() { |
|
142 | |||
143 | /** |
||
144 | * @since 0.6.6 |
||
145 | */ |
||
146 | public function getFeatureInstance( $featureName ) { |
||
155 | |||
156 | /** |
||
157 | * @since 0.6.3 |
||
158 | */ |
||
159 | public function getFeature( $featureName ) { |
||
162 | |||
163 | /** |
||
164 | * @since 0.6.3 |
||
165 | */ |
||
166 | 19 | public function getAliases() { |
|
169 | |||
170 | /** |
||
171 | * @since 0.6.3 |
||
172 | */ |
||
173 | 7 | public function hasAlias( $alias ) { |
|
176 | |||
177 | /** |
||
178 | * Add one or more names of resource modules that should be loaded. |
||
179 | * |
||
180 | * @since 0.7.3 |
||
181 | * |
||
182 | * @param mixed $modules Array of string or string |
||
183 | */ |
||
184 | public function addResourceModules( $modules ) { |
||
187 | |||
188 | /** |
||
189 | * @param array $dependencies |
||
190 | */ |
||
191 | 19 | public function addHtmlDependencies( array $dependencies ) { |
|
196 | |||
197 | /** |
||
198 | * @since 0.6.3 |
||
199 | * |
||
200 | * @param $dependencyHtml |
||
201 | */ |
||
202 | public final function addHtmlDependency( $dependencyHtml ) { |
||
205 | |||
206 | /** |
||
207 | * @since 1.0 |
||
208 | */ |
||
209 | public function getEarthZoom() { |
||
212 | |||
213 | public abstract function getMapId( $increment = true ); |
||
214 | |||
215 | } |
||
216 |
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: