Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Model/Asn.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class Asn implements \JsonSerializable
public function __construct(array $raw)
{
$this->autonomousSystemNumber = $raw['autonomous_system_number'] ?? null;
$this->autonomousSystemOrganization =
$raw['autonomous_system_organization'] ?? null;
$this->autonomousSystemOrganization
= $raw['autonomous_system_organization'] ?? null;
$ipAddress = $raw['ip_address'];
$this->ipAddress = $ipAddress;
$this->network = Util::cidr($ipAddress, $raw['prefix_len']);
Expand Down
16 changes: 8 additions & 8 deletions src/Model/City.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,22 @@ public function __construct(array $raw, array $locales = ['en'])

if (!isset($raw['subdivisions'])) {
$this->subdivisions = [];
$this->mostSpecificSubdivision =
new Subdivision([], $locales);
$this->mostSpecificSubdivision
= new Subdivision([], $locales);

return;
}

$subdivisions = [];
foreach ($raw['subdivisions'] as $sub) {
$subdivisions[] =
new Subdivision($sub, $locales)
$subdivisions[]
= new Subdivision($sub, $locales)
;
}

// Not using end as we don't want to modify internal pointer.
$this->mostSpecificSubdivision =
$subdivisions[\count($subdivisions) - 1];
$this->mostSpecificSubdivision
= $subdivisions[\count($subdivisions) - 1];
$this->subdivisions = $subdivisions;
}

Expand All @@ -110,8 +110,8 @@ public function jsonSerialize(): ?array
$js['location'] = $location;
}

$postal =
$this->postal->jsonSerialize();
$postal
= $this->postal->jsonSerialize();
if (!empty($postal)) {
$js['postal'] = $postal;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Isp.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class Isp implements \JsonSerializable
public function __construct(array $raw)
{
$this->autonomousSystemNumber = $raw['autonomous_system_number'] ?? null;
$this->autonomousSystemOrganization =
$raw['autonomous_system_organization'] ?? null;
$this->autonomousSystemOrganization
= $raw['autonomous_system_organization'] ?? null;
$this->isp = $raw['isp'] ?? null;
$this->mobileCountryCode = $raw['mobile_country_code'] ?? null;
$this->mobileNetworkCode = $raw['mobile_network_code'] ?? null;
Expand Down
16 changes: 8 additions & 8 deletions tests/GeoIp2/Test/Database/ReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
*/
class ReaderTest extends TestCase
{
/**
* @return array<list<string>>
*/
public static function databaseTypes(): array
{
return [['City', 'city'], ['Country', 'country']];
}

/**
* @dataProvider databaseTypes
*/
Expand Down Expand Up @@ -78,6 +70,14 @@ public function testIsInEuropeanUnion(string $type, string $method): void
$reader->close();
}

/**
* @return array<list<string>>
*/
public static function databaseTypes(): array
{
return [['City', 'city'], ['Country', 'country']];
}

public function testUnknownAddress(): void
{
$this->expectException(AddressNotFoundException::class);
Expand Down
4 changes: 2 additions & 2 deletions tests/GeoIp2/Test/Model/CountryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ public function testValues(): void

public function testJsonSerialize(): void
{
$js =
[
$js
= [
'continent' => [
'names' => ['en' => 'North America'],
'code' => 'NA',
Expand Down
4 changes: 2 additions & 2 deletions tests/GeoIp2/Test/WebService/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,8 @@ private function makeRequest(

// On macOS, when the SSL version is "SecureTransport", the system's
// keychain will be used.
$caBundle = $curlVersion['ssl_version'] === 'SecureTransport' ?
null : CaBundle::getSystemCaRootBundlePath();
$caBundle = $curlVersion['ssl_version'] === 'SecureTransport'
? null : CaBundle::getSystemCaRootBundlePath();

$curlVersion = curl_version();
$factory->expects($this->exactly($callsToRequest))
Expand Down