lib/LongitudeOne/Spatial/PHP/Types/AbstractMultiLineString.php
Avoid using LongitudeOne\Spatial\PHP\Types\count() function in for loops. Open
Open
for ($i = 0; $i < count($this->lineStrings); ++$i) {
$lineStrings[] = $this->getLineString($i);
}
- Read upRead up
- Exclude checks
CountInLoopExpression
Since: 2.7.0
Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.
Example
class Foo {
public function bar()
{
$array = array();
for ($i = 0; count($array); $i++) {
// ...
}
}
}
Source https://phpmd.org/rules/design.html#countinloopexpression
Line exceeds 120 characters; contains 133 characters Open
Open
* @param (float|int)[][]|LineStringInterface|MultiPointInterface|PointInterface[] $lineString the line string to add to Geometry
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
Open
* @param ((float|int)[][]|LineStringInterface|MultiPointInterface|PointInterface[])[] $lineStrings array of linestring
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
Open
* @param ((float|int)[][]|LineStringInterface|MultiPointInterface|PointInterface[])[] $lineStrings array of LineString
- Exclude checks
Line exceeds 120 characters; contains 139 characters Open
Open
* @param null|int $srid Spatial Reference System Identifier
- Exclude checks