Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Nov 10, 2023
1 parent 6f9121c commit 1d8207e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/Api/GeoIP.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public function get(string $ip)

/**
* @param array $ips
*
* @return ServiceResponse[]|void
*/
public function getBatch(array $ips)
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ServiceResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ServiceResponse implements \JsonSerializable
* @var string
*/
private $ip;

/**
* @var bool
*/
Expand Down
6 changes: 3 additions & 3 deletions src/Api/Services/IPApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected function buildUrl(string $ip, ?string $apiKey): string

protected function buildBatchUrl(array $ips, ?string $apiKey): string
{
return '/batch?' . http_build_query(['fields' => $this->requestFields]);
return '/batch?'.http_build_query(['fields' => $this->requestFields]);
}

protected function requiresApiKey(): bool
Expand All @@ -41,10 +41,10 @@ protected function getRequestOptions(?string $apiKey, array $ips = null): array
if ($ips) {
return [
'http_errors' => false,
'json' => $ips
'json' => $ips,
];
}

return [
'http_errors' => false,
'query' => [
Expand Down
9 changes: 9 additions & 0 deletions src/Command/FetchIPInfoBatch.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of fof/geoip.
*
* Copyright (c) FriendsOfFlarum.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace FoF\GeoIP\Command;

use Flarum\User\User;
Expand Down
11 changes: 10 additions & 1 deletion src/Command/FetchIPInfoBatchHandler.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of fof/geoip.
*
* Copyright (c) FriendsOfFlarum.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace FoF\GeoIP\Command;

use FoF\GeoIP\Api\GeoIP;
Expand All @@ -26,7 +35,7 @@ public function handle(FetchIPInfoBatch $command)

if (count($ipsToQuery) > 0) {
$responses = $this->geoip->getBatch($ipsToQuery);

foreach ($responses as $response) {
$ipInfo = new IPInfo();
$ipInfo->address = $response->getIP();
Expand Down

0 comments on commit 1d8207e

Please sign in to comment.