1 | <?php |
||
15 | class NearbyParserFunction { |
||
16 | |||
17 | /** |
||
18 | * @var Parser |
||
19 | */ |
||
20 | private $parser; |
||
21 | |||
22 | /** |
||
23 | * @since 1.0 |
||
24 | * |
||
25 | * @return Parser $parser |
||
|
|||
26 | */ |
||
27 | 6 | public function __construct( Parser $parser ) { |
|
30 | |||
31 | /** |
||
32 | * @since 1.0 |
||
33 | * |
||
34 | * @param array $params |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | 5 | public function parse( array $params ) { |
|
71 | |||
72 | 5 | private function getHtmlFor( $class, $parameters ) { |
|
73 | 5 | return Html::rawElement( |
|
74 | 5 | 'div', |
|
75 | array( |
||
76 | 5 | 'class' => $class . ( isset( $parameters['class'] ) ? ' ' . $parameters['class'] : '' ), |
|
77 | 5 | 'data-parameters' => json_encode( $parameters ) |
|
78 | 5 | ), |
|
79 | 5 | Html::rawElement( 'div', array( 'id' => 'controls', 'style' => 'display:none' ) ) . |
|
80 | 5 | Html::rawElement( 'div', array( 'id' => 'selection', 'style' => 'display:none' ) ) . |
|
81 | 5 | Html::rawElement( 'div', array( 'id' => 'status' ), |
|
82 | 5 | Html::rawElement( 'span', array( 'class' => 'geolocation' ) ) . |
|
83 | 5 | Html::rawElement( 'span', array( 'class' => 'localcache' ) ) . |
|
84 | 5 | Html::rawElement( 'span', array( 'class' => 'error' ) ) |
|
85 | 5 | ) . |
|
86 | 5 | Html::rawElement( 'div', array( 'id' => 'output', 'style' => 'opacity: 0.5;' ), wfMessage( 'wnby-loading' )->text() ) |
|
87 | 5 | ); |
|
88 | } |
||
89 | |||
90 | 5 | private function doValidateKeyValueForParameterMatch( $key, $value, &$class, &$parameters ) { |
|
110 | |||
111 | 5 | private function addMapServicesToOutput( &$parameters ) { |
|
142 | |||
143 | } |
||
144 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.