1 | <?php |
||
19 | class LineParser extends StringValueParser { |
||
20 | |||
21 | protected $supportGeocoding = true; |
||
22 | |||
23 | // TODO: use options |
||
24 | protected $metaDataSeparator = '~'; |
||
25 | |||
26 | /** |
||
27 | * @see StringValueParser::stringParse |
||
28 | * |
||
29 | * @since 3.0 |
||
30 | * |
||
31 | * @param string $value |
||
32 | * |
||
33 | * @return Line |
||
34 | */ |
||
35 | 2 | public function stringParse( $value ) { |
|
46 | |||
47 | /** |
||
48 | * @since 3.0 |
||
49 | * |
||
50 | * @param string[] $coordinateStrings |
||
51 | * |
||
52 | * @return LatLongValue[] |
||
53 | */ |
||
54 | 2 | protected function parseCoordinates( array $coordinateStrings ) { |
|
78 | |||
79 | 2 | protected function constructShapeFromLatLongValues( array $locations ) { |
|
82 | |||
83 | /** |
||
84 | * This method requires that parameters are positionally correct, |
||
85 | * 1. Link (one parameter) or bubble data (two parameters) |
||
86 | * 2. Stroke data (three parameters) |
||
87 | * 3. Fill data (two parameters) |
||
88 | * e.g ...title~text~strokeColor~strokeOpacity~strokeWeight~fillColor~fillOpacity |
||
89 | * |
||
90 | * @since 3.0 |
||
91 | * |
||
92 | * @param array $params |
||
93 | * @param Line $line |
||
94 | */ |
||
95 | 2 | protected function handleCommonParams( array &$params, Line &$line ) { |
|
121 | |||
122 | 2 | protected function setBubbleDataFromParameter( Line &$line , &$params , $title ) { |
|
130 | |||
131 | protected function setLinkFromParameter( Line &$line , $link ) { |
||
139 | |||
140 | /** |
||
141 | * Checks if a string is prefixed with link: |
||
142 | * @static |
||
143 | * @param $link |
||
144 | * @return bool|string |
||
145 | * @since 2.0 |
||
146 | */ |
||
147 | 2 | private function isLinkParameter( $link ) { |
|
154 | |||
155 | } |
||
156 |
This check looks for the bodies of
if
statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.These
if
bodies can be removed. If you have an empty if but statements in theelse
branch, consider inverting the condition.could be turned into
This is much more concise to read.