@@ -11,13 +11,13 @@ discard block |
||
| 11 | 11 | * |
| 12 | 12 | * @var GeoipDatabase |
| 13 | 13 | **/ |
| 14 | - private $oDBInstance=null; |
|
| 14 | + private $oDBInstance = null; |
|
| 15 | 15 | /** |
| 16 | 16 | * Network tools class instance |
| 17 | 17 | * |
| 18 | 18 | * @var GeoipNetwork |
| 19 | 19 | **/ |
| 20 | - private $oNetwork=null; |
|
| 20 | + private $oNetwork = null; |
|
| 21 | 21 | /** |
| 22 | 22 | * Class Constructor |
| 23 | 23 | * |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param string|null $ipAddress |
| 36 | 36 | * @return string |
| 37 | 37 | */ |
| 38 | - public function resolve(string $ipAddress= null): string |
|
| 38 | + public function resolve(string $ipAddress = null): string |
|
| 39 | 39 | { |
| 40 | 40 | $ipAddress || $ipAddress = $this->oNetwork->getIPAddress(); |
| 41 | 41 | if ($this->oNetwork->isIpAddress($ipAddress)): |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | * @param mixed|null $ipAddress |
| 50 | 50 | * @return bool |
| 51 | 51 | */ |
| 52 | - public function isReservedAddress($ipAddress=null): bool |
|
| 52 | + public function isReservedAddress($ipAddress = null): bool |
|
| 53 | 53 | { |
| 54 | 54 | $ipAddress || $ipAddress = $this->oNetwork->getIPAddress(); |
| 55 | 55 | $countryCode = $this->resolve($ipAddress); |
| 56 | - return !$countryCode || strcasecmp($countryCode, 'ZZ') == 0 ; |
|
| 56 | + return !$countryCode || strcasecmp($countryCode, 'ZZ') == 0; |
|
| 57 | 57 | } |
| 58 | 58 | } |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | $destination = rtrim(dirname(__DIR__), self::DS); |
| 78 | 78 | $info = new \SplFileInfo($database); |
| 79 | 79 | $dbName = $info->getFilename(); |
| 80 | - $dbSuffix ='.sqlite'; |
|
| 81 | - if (substr_compare(strtolower($dbName), $dbSuffix, -strlen($dbSuffix)) !== 0) { $dbName .= $dbSuffix ; } |
|
| 80 | + $dbSuffix = '.sqlite'; |
|
| 81 | + if (substr_compare(strtolower($dbName), $dbSuffix, -strlen($dbSuffix)) !== 0) { $dbName .= $dbSuffix; } |
|
| 82 | 82 | } catch (\Throwable $th) { |
| 83 | 83 | trigger_error($th->getMessage(), E_USER_ERROR); |
| 84 | 84 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $sCommand .= 'WHERE `start` <= :start '; |
| 144 | 144 | $sCommand .= 'ORDER BY start DESC LIMIT 1'; |
| 145 | 145 | $statement = $this->oPDOInstance->prepare(sprintf($sCommand, $ipVersion)); |
| 146 | - $statement->execute([':start' => $start ]); |
|
| 146 | + $statement->execute([':start' => $start]); |
|
| 147 | 147 | $row = $statement->fetch(\PDO::FETCH_OBJ); |
| 148 | 148 | if (is_bool($row) && $row === false) |
| 149 | 149 | { |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | ':country' => $country |
| 202 | 202 | ]); |
| 203 | 203 | } catch (\PDOException $th) { |
| 204 | - trigger_error('Statement failed: ' . $th->getMessage(), E_USER_ERROR); |
|
| 204 | + trigger_error('Statement failed: '.$th->getMessage(), E_USER_ERROR); |
|
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | /** |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | public function beginTransaction() |
| 213 | 213 | { |
| 214 | - if (!$this->transactionCounter++) {return $this->oPDOInstance->beginTransaction();} |
|
| 214 | + if (!$this->transactionCounter++) {return $this->oPDOInstance->beginTransaction(); } |
|
| 215 | 215 | return $this->transactionCounter >= 0; |
| 216 | 216 | } |
| 217 | 217 | /** |