@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | public static function fromGridReference(string $ref): self |
| 94 | 94 | { |
| 95 | 95 | $tetrad = FALSE; |
| 96 | - if(strlen($ref) === 5) { |
|
| 96 | + if (strlen($ref) === 5) { |
|
| 97 | 97 | $tetrad = TRUE; |
| 98 | 98 | } elseif (strlen($ref) % 2 !== 0) { |
| 99 | 99 | throw new LengthException('Grid ref must be an even number of characters'); |
@@ -110,13 +110,13 @@ discard block |
||
| 110 | 110 | //tetrad letter is 2km grid sq. THE GRID HAS A DIFFERENT ORIENTATION - starts botom left and runs bottom to top. Includes I but no O. |
| 111 | 111 | $tetradEasting = 0; |
| 112 | 112 | $tetradNorthing = 0; |
| 113 | - if($tetrad) { |
|
| 113 | + if ($tetrad) { |
|
| 114 | 114 | $tetradEasting = strpos(self::GRID_LETTERS_TETRAD, $ref[4]) % 5 * 2000; |
| 115 | 115 | $tetradNorthing = (floor(strpos(self::GRID_LETTERS_TETRAD, $ref[4]) / 5)) * 2000; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | //numbers are a division of that square into smaller and smaller pieces |
| 119 | - if($tetrad) { |
|
| 119 | + if ($tetrad) { |
|
| 120 | 120 | $numericPortion = substr($ref, 2, 2); |
| 121 | 121 | $numericPortionSize = strlen($numericPortion) / 2; |
| 122 | 122 | } else { |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $minorLetterIndex = (5 * $minorSquaresNorth + $minorSquaresEast); |
| 165 | 165 | $minorLetter = substr(self::GRID_LETTERS, $minorLetterIndex, 1); |
| 166 | 166 | |
| 167 | - return $majorLetter . $minorLetter . substr($easting, 1, $halfLength) . substr($northing, 1, $halfLength); |
|
| 167 | + return $majorLetter.$minorLetter.substr($easting, 1, $halfLength).substr($northing, 1, $halfLength); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |