@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | { |
74 | 74 | |
75 | 75 | //first (major) letter is the 500km grid sq, origin at -1000000, -500000 |
76 | - $majorEasting = strpos(self::GRID_LETTERS, $ref[0]) % 5 * 500000 - 1000000; |
|
76 | + $majorEasting = strpos(self::GRID_LETTERS, $ref[0]) % 5 * 500000 - 1000000; |
|
77 | 77 | $majorNorthing = (floor(strpos(self::GRID_LETTERS, $ref[0]) / 5)) * 500000 - 500000; |
78 | 78 | |
79 | 79 | //second (minor) letter is 100km grid sq, origin at 0,0 of this square |
80 | - $minorEasting = strpos(self::GRID_LETTERS, $ref[1]) % 5 * 100000; |
|
80 | + $minorEasting = strpos(self::GRID_LETTERS, $ref[1]) % 5 * 100000; |
|
81 | 81 | $minorNorthing = (floor(strpos(self::GRID_LETTERS, $ref[1]) / 5)) * 100000; |
82 | 82 | |
83 | 83 | $easting = $majorEasting + $minorEasting + (substr($ref, 2, 3) * 100); |
@@ -103,13 +103,13 @@ discard block |
||
103 | 103 | $adjustedY = $this->y + 500000; |
104 | 104 | $majorSquaresEast = floor($adjustedX / 500000); |
105 | 105 | $majorSquaresNorth = floor($adjustedY / 500000); |
106 | - $majorLetterIndex = (int)(5 * $majorSquaresNorth + $majorSquaresEast); |
|
106 | + $majorLetterIndex = (int) (5 * $majorSquaresNorth + $majorSquaresEast); |
|
107 | 107 | $majorLetter = substr(self::GRID_LETTERS, $majorLetterIndex, 1); |
108 | 108 | |
109 | 109 | //second (minor) letter is 100km grid sq, origin at 0,0 of this square |
110 | 110 | $minorSquaresEast = $easting[0] % 5; |
111 | 111 | $minorSquaresNorth = $northing[0] % 5; |
112 | - $minorLetterIndex = (int)(5 * $minorSquaresNorth + $minorSquaresEast); |
|
112 | + $minorLetterIndex = (int) (5 * $minorSquaresNorth + $minorSquaresEast); |
|
113 | 113 | $minorLetter = substr(self::GRID_LETTERS, $minorLetterIndex, 1); |
114 | 114 | |
115 | 115 | return $majorLetter . $minorLetter . substr($easting, 1, 3) . substr($northing, 1, 3); |
@@ -132,13 +132,13 @@ discard block |
||
132 | 132 | $adjustedY = $this->y + 500000; |
133 | 133 | $majorSquaresEast = floor($adjustedX / 500000); |
134 | 134 | $majorSquaresNorth = floor($adjustedY / 500000); |
135 | - $majorLetterIndex = (int)(5 * $majorSquaresNorth + $majorSquaresEast); |
|
135 | + $majorLetterIndex = (int) (5 * $majorSquaresNorth + $majorSquaresEast); |
|
136 | 136 | $majorLetter = substr(self::GRID_LETTERS, $majorLetterIndex, 1); |
137 | 137 | |
138 | 138 | //second (minor) letter is 100km grid sq, origin at 0,0 of this square |
139 | 139 | $minorSquaresEast = $easting[0] % 5; |
140 | 140 | $minorSquaresNorth = $northing[0] % 5; |
141 | - $minorLetterIndex = (int)(5 * $minorSquaresNorth + $minorSquaresEast); |
|
141 | + $minorLetterIndex = (int) (5 * $minorSquaresNorth + $minorSquaresEast); |
|
142 | 142 | $minorLetter = substr(self::GRID_LETTERS, $minorLetterIndex, 1); |
143 | 143 | |
144 | 144 | return $majorLetter . $minorLetter . substr($easting, 1, 4) . substr($northing, 1, 4); |
@@ -161,13 +161,13 @@ discard block |
||
161 | 161 | $adjustedY = $this->y + 500000; |
162 | 162 | $majorSquaresEast = floor($adjustedX / 500000); |
163 | 163 | $majorSquaresNorth = floor($adjustedY / 500000); |
164 | - $majorLetterIndex = (int)(5 * $majorSquaresNorth + $majorSquaresEast); |
|
164 | + $majorLetterIndex = (int) (5 * $majorSquaresNorth + $majorSquaresEast); |
|
165 | 165 | $majorLetter = substr(self::GRID_LETTERS, $majorLetterIndex, 1); |
166 | 166 | |
167 | 167 | //second (minor) letter is 100km grid sq, origin at 0,0 of this square |
168 | 168 | $minorSquaresEast = $easting[0] % 5; |
169 | 169 | $minorSquaresNorth = $northing[0] % 5; |
170 | - $minorLetterIndex = (int)(5 * $minorSquaresNorth + $minorSquaresEast); |
|
170 | + $minorLetterIndex = (int) (5 * $minorSquaresNorth + $minorSquaresEast); |
|
171 | 171 | $minorLetter = substr(self::GRID_LETTERS, $minorLetterIndex, 1); |
172 | 172 | |
173 | 173 | return $majorLetter . $minorLetter . substr($easting, 1, 5) . substr($northing, 1, 5); |