@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public static function fromGridReference(string $ref): self |
94 | 94 | { |
95 | - if(strlen($ref) === 5) { |
|
95 | + if (strlen($ref) === 5) { |
|
96 | 96 | $tetrad = TRUE; |
97 | 97 | } elseif (strlen($ref) % 2 !== 0) { |
98 | 98 | throw new LengthException('Grid ref must be an even number of characters'); |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | //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. |
110 | 110 | $tetradEasting = 0; |
111 | 111 | $tetradNorthing = 0; |
112 | - if($tetrad) { |
|
112 | + if ($tetrad) { |
|
113 | 113 | $tetradEasting = strpos(self::GRID_LETTERS_TETRAD, $ref[4]) % 5 * 2000; |
114 | 114 | $tetradNorthing = (floor(strpos(self::GRID_LETTERS_TETRAD, $ref[4]) / 5)) * 2000; |
115 | 115 | } |
116 | 116 | |
117 | 117 | //numbers are a division of that square into smaller and smaller pieces |
118 | - if($tetrad) { |
|
118 | + if ($tetrad) { |
|
119 | 119 | $numericPortion = substr($ref, 2, 2); |
120 | 120 | $numericPortionSize = strlen($numericPortion) / 2; |
121 | 121 | } else { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $minorLetterIndex = (5 * $minorSquaresNorth + $minorSquaresEast); |
164 | 164 | $minorLetter = substr(self::GRID_LETTERS, $minorLetterIndex, 1); |
165 | 165 | |
166 | - return $majorLetter . $minorLetter . substr($easting, 1, $halfLength) . substr($northing, 1, $halfLength); |
|
166 | + return $majorLetter.$minorLetter.substr($easting, 1, $halfLength).substr($northing, 1, $halfLength); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |