1 | <?php |
||
20 | class LineParser implements ValueParser { |
||
21 | |||
22 | private $metaDataSeparator = '~'; |
||
23 | |||
24 | private $geocoder; |
||
25 | |||
26 | public function __construct() { |
||
29 | |||
30 | public function setGeocoder( Geocoder $geocoder ) { |
||
33 | |||
34 | /** |
||
35 | * @see StringValueParser::stringParse |
||
36 | * |
||
37 | * @since 3.0 |
||
38 | * |
||
39 | * @param string $value |
||
40 | * |
||
41 | * @return Line |
||
42 | */ |
||
43 | public function parse( $value ) { |
||
56 | |||
57 | protected function constructShapeFromLatLongValues( array $locations ) { |
||
60 | |||
61 | /** |
||
62 | * @since 3.0 |
||
63 | * |
||
64 | * @param string[] $coordinateStrings |
||
65 | * |
||
66 | * @return LatLongValue[] |
||
67 | */ |
||
68 | protected function parseCoordinates( array $coordinateStrings ) { |
||
83 | |||
84 | /** |
||
85 | * This method requires that parameters are positionally correct, |
||
86 | * 1. Link (one parameter) or bubble data (two parameters) |
||
87 | * 2. Stroke data (three parameters) |
||
88 | * 3. Fill data (two parameters) |
||
89 | * e.g ...title~text~strokeColor~strokeOpacity~strokeWeight~fillColor~fillOpacity |
||
90 | * |
||
91 | * @since 3.0 |
||
92 | * |
||
93 | * @param array $params |
||
94 | * @param Line $line |
||
95 | */ |
||
96 | protected function handleCommonParams( array &$params, Line &$line ) { |
||
121 | |||
122 | /** |
||
123 | * Checks if a string is prefixed with link: |
||
124 | * |
||
125 | * @static |
||
126 | * |
||
127 | * @param $link |
||
128 | * |
||
129 | * @return bool|string |
||
130 | * @since 2.0 |
||
131 | */ |
||
132 | private function isLinkParameter( $link ) { |
||
139 | |||
140 | protected function setLinkFromParameter( Line &$line, $link ) { |
||
148 | |||
149 | protected function setBubbleDataFromParameter( Line &$line, &$params, $title ) { |
||
157 | |||
158 | } |
||
159 |
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.