File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ protected function generateCodeArea(string $strippedCode): CodeArea
8181 // Define the place value for the digits. We'll divide this down as we work through the code.
8282 $ latPlaceVal = self ::LAT_MSP_VALUE ;
8383 $ lngPlaceVal = self ::LNG_MSP_VALUE ;
84- for ($ i = OpenLocationCode:: PAIR_CODE_LENGTH ; $ i < min (strlen ($ strippedCode ), OpenLocationCode::MAX_DIGIT_COUNT ); $ i += 2 ) {
84+ for ($ i = 0 ; $ i < min (strlen ($ strippedCode ), OpenLocationCode::MAX_DIGIT_COUNT ); $ i += 2 ) {
8585 $ latPlaceVal = floor ($ latPlaceVal / OpenLocationCode::ENCODING_BASE );
8686 $ lngPlaceVal = floor ($ lngPlaceVal / OpenLocationCode::ENCODING_BASE );
8787 $ latVal += strpos (OpenLocationCode::CODE_ALPHABET , $ strippedCode [$ i ]) * $ latPlaceVal ;
Original file line number Diff line number Diff line change @@ -83,11 +83,11 @@ protected function generateCodeArea(string $strippedCode): CodeArea
8383 // Define the place value for the digits. We'll divide this down as we work through the code.
8484 $ latPlaceVal = self ::LAT_MSP_VALUE ;
8585 $ lngPlaceVal = self ::LNG_MSP_VALUE ;
86- for ($ i = OpenLocationCode:: PAIR_CODE_LENGTH ; $ i < min (strlen ($ strippedCode ), OpenLocationCode::MAX_DIGIT_COUNT ); $ i += 2 ) {
86+ for ($ i = 0 ; $ i < min (strlen ($ strippedCode ), OpenLocationCode::MAX_DIGIT_COUNT ); $ i += 2 ) {
8787 $ latPlaceVal = intdiv ($ latPlaceVal , OpenLocationCode::ENCODING_BASE );
8888 $ lngPlaceVal = intdiv ($ lngPlaceVal , OpenLocationCode::ENCODING_BASE );
8989 $ latVal += strpos (OpenLocationCode::CODE_ALPHABET , $ strippedCode [$ i ]) * $ latPlaceVal ;
90- $ lngVal = strpos (OpenLocationCode::CODE_ALPHABET , $ strippedCode [$ i + 1 ]) * $ lngPlaceVal ;
90+ $ lngVal + = strpos (OpenLocationCode::CODE_ALPHABET , $ strippedCode [$ i + 1 ]) * $ lngPlaceVal ;
9191 }
9292 unset($ i );
9393 for ($ i = OpenLocationCode::PAIR_CODE_LENGTH ; $ i < min (strlen ($ strippedCode ), OpenLocationCode::MAX_DIGIT_COUNT ); $ i ++) {
You can’t perform that action at this time.
0 commit comments