77class MultiLineString extends GeometryCollection
88{
99 /**
10- * @param LineString[] $linestrings
10+ * @param LineString[] $lineStrings
1111 */
12- public function __construct (array $ linestrings )
12+ public function __construct (array $ lineStrings )
1313 {
14- if (count ($ linestrings ) < 1 ) {
15- throw new InvalidArgumentException ('$linestrings must contain at least one entry ' );
14+ if (count ($ lineStrings ) < 1 ) {
15+ throw new InvalidArgumentException ('$lineStrings must contain at least one entry ' );
1616 }
1717
18- $ validated = array_filter ($ linestrings , function ($ value ) {
18+ $ validated = array_filter ($ lineStrings , function ($ value ) {
1919 return $ value instanceof LineString;
2020 });
2121
22- if (count ($ linestrings ) !== count ($ validated )) {
23- throw new InvalidArgumentException ('$linestrings must be an array of LineString ' );
22+ if (count ($ lineStrings ) !== count ($ validated )) {
23+ throw new InvalidArgumentException ('$lineStrings must be an array of LineString ' );
2424 }
2525
26- parent ::__construct ($ linestrings );
26+ parent ::__construct ($ lineStrings );
2727 }
2828
2929 public function getLineStrings ()
@@ -39,17 +39,17 @@ public function toWKT()
3939 public static function fromString ($ wktArgument )
4040 {
4141 $ str = preg_split ('/\)\s*,\s*\(/ ' , substr (trim ($ wktArgument ), 1 , -1 ));
42- $ linestrings = array_map (function ($ data ) {
42+ $ lineStrings = array_map (function ($ data ) {
4343 return LineString::fromString ($ data );
4444 }, $ str );
4545
46- return new static ($ linestrings );
46+ return new static ($ lineStrings );
4747 }
4848
4949 public function __toString ()
5050 {
51- return implode (', ' , array_map (function (LineString $ linestring ) {
52- return sprintf ('(%s) ' , (string ) $ linestring );
51+ return implode (', ' , array_map (function (LineString $ lineString ) {
52+ return sprintf ('(%s) ' , (string ) $ lineString );
5353 }, $ this ->getLineStrings ()));
5454 }
5555
@@ -69,12 +69,12 @@ public function offsetSet($offset, $value)
6969 */
7070 public function jsonSerialize ()
7171 {
72- $ linestrings = [];
72+ $ lineStrings = [];
7373
74- foreach ($ this ->items as $ linestring ) {
75- $ linestrings [] = $ linestring ->jsonSerialize ();
74+ foreach ($ this ->items as $ lineString ) {
75+ $ lineStrings [] = $ lineString ->jsonSerialize ();
7676 }
7777
78- return new \GeoJson \Geometry \MultiLineString ($ linestrings );
78+ return new \GeoJson \Geometry \MultiLineString ($ lineStrings );
7979 }
8080}
0 commit comments