File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 22
33namespace geoPHP \Adapter ;
44
5- use geoPHP \geoPHP ;
65use geoPHP \Geometry \Geometry ;
76use geoPHP \Geometry \GeometryCollection ;
87use geoPHP \Geometry \Point ;
Original file line number Diff line number Diff line change @@ -178,8 +178,11 @@ protected function parseGeometryCollection($xml) {
178178 $ geom_types = geoPHP::getGeometryList ();
179179 foreach ($ xml ->childNodes as $ child ) {
180180 /** @noinspection SpellCheckingInspection */
181- $ nodeName = ($ child ->nodeName == 'linearring ' ) ? 'linestring ' : $ child ->nodeName ;
182- $ nodeName = ($ child ->nodeName == 'multigeometry ' ) ? 'geometrycollection ' : $ child ->nodeName ;
181+ $ nodeName = ($ child ->nodeName == 'linearring ' )
182+ ? 'linestring '
183+ : ($ child ->nodeName == 'multigeometry '
184+ ? 'geometrycollection '
185+ : $ child ->nodeName );
183186 if (array_key_exists ($ nodeName , $ geom_types )) {
184187 $ function = 'parse ' . $ geom_types [$ nodeName ];
185188 $ components [] = $ this ->$ function ($ child );
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ protected function geomFromXML() {
6868 // Processing OSM Nodes
6969 $ nodes = [];
7070 foreach ($ this ->xmlObj ->getElementsByTagName ('node ' ) as $ node ) {
71+ /** @var \DOMElement $node */
7172 $ lat = $ node ->attributes ->getNamedItem ('lat ' )->nodeValue ;
7273 $ lon = $ node ->attributes ->getNamedItem ('lon ' )->nodeValue ;
7374 $ id = intval ($ node ->attributes ->getNamedItem ('id ' )->nodeValue );
@@ -92,6 +93,7 @@ protected function geomFromXML() {
9293 // Processing OSM Ways
9394 $ ways = [];
9495 foreach ($ this ->xmlObj ->getElementsByTagName ('way ' ) as $ way ) {
96+ /** @var \DOMElement $way */
9597 $ id = intval ($ way ->attributes ->getNamedItem ('id ' )->nodeValue );
9698 $ wayNodes = [];
9799 foreach ($ way ->getElementsByTagName ('nd ' ) as $ node ) {
@@ -122,11 +124,12 @@ protected function geomFromXML() {
122124
123125 // Processing OSM Relations
124126 foreach ($ this ->xmlObj ->getElementsByTagName ('relation ' ) as $ relation ) {
125- /** @var Point[] $relationPoints */
127+ /** @var \DOMElement $relation */
128+ /** @var Point[] */
126129 $ relationPoints = [];
127- /** @var LineString[] $relationLines */
130+ /** @var LineString[] */
128131 $ relationLines = [];
129- /** @var Polygon[] $relationPolygons */
132+ /** @var Polygon[] */
130133 $ relationPolygons = [];
131134
132135 static $ polygonalTypes = ['multipolygon ' , 'boundary ' ];
You can’t perform that action at this time.
0 commit comments