Skip to content

Commit 6e9443a

Browse files
authored
Merge pull request #156 from maxmind/greg/fix-linting-issues
Run new php-cs-fixer against code
2 parents d695fd1 + 0b49e70 commit 6e9443a

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

bin/benchmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
$count = 40000;
1212
$startTime = microtime(true);
1313
for ($i = 0; $i < $count; $i++) {
14-
$ip = long2ip(rand(0, pow(2, 32) - 1));
14+
$ip = long2ip(rand(0, 2 ** 32 - 1));
1515
try {
1616
$t = $reader->city($ip);
1717
} catch (AddressNotFoundException $e) {

examples/benchmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
$count = 500000;
1111
$startTime = microtime(true);
1212
for ($i = 0; $i < $count; ++$i) {
13-
$ip = long2ip(rand(0, pow(2, 32) - 1));
13+
$ip = long2ip(rand(0, 2 ** 32 - 1));
1414
try {
1515
$t = $reader->city($ip);
1616
} catch (\GeoIp2\Exception\AddressNotFoundException $e) {

src/Database/Reader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private function getRecord(string $class, string $type, string $ipAddress): arra
258258
*
259259
* @return \MaxMind\Db\Reader\Metadata object for the database
260260
*/
261-
public function metadata(): \MaxMind\Db\Reader\Metadata
261+
public function metadata(): DbReader\Metadata
262262
{
263263
return $this->dbReader->metadata();
264264
}

src/Model/City.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@ private function createSubdivisions(array $raw, array $locales): void
6969
}
7070

7171
foreach ($raw['subdivisions'] as $sub) {
72-
array_push(
73-
$this->subdivisions,
72+
$this->subdivisions[] =
7473
new \GeoIp2\Record\Subdivision($sub, $locales)
75-
);
74+
;
7675
}
7776
}
7877

src/ProviderInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ interface ProviderInterface
1111
*
1212
* @return \GeoIp2\Model\Country a Country model for the requested IP address
1313
*/
14-
public function country(string $ipAddress): \GeoIp2\Model\Country;
14+
public function country(string $ipAddress): Model\Country;
1515

1616
/**
1717
* @param string $ipAddress an IPv4 or IPv6 address to lookup
1818
*
1919
* @return \GeoIp2\Model\City a City model for the requested IP address
2020
*/
21-
public function city(string $ipAddress): \GeoIp2\Model\City;
21+
public function city(string $ipAddress): Model\City;
2222
}

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
if (!$loader = @include __DIR__ . '/../vendor/autoload.php') {
6-
die('Project dependencies missing');
6+
exit('Project dependencies missing');
77
}
88

99
$loader->add('GeoIp2\Test', __DIR__);

0 commit comments

Comments
 (0)