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 9, 2023
1 parent 4102167 commit f729a55
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

(new Extend\Routes('api'))
->get('/ip_info/{ip}', 'fof-geoip.api.ip_info', Api\Controller\ShowIpInfoController::class),

(new Extend\Console())
->command(Console\LookupUnknownIPsCommand::class),
];
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.
*/

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;

Expand Down
2 changes: 1 addition & 1 deletion src/Api/ServiceResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace FoF\GeoIP\Api;

class ServiceResponse implements \JsonSerializable
{
{
/**
* @var bool
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Services/IPData.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function parseResponse(object $body): ServiceResponse

$response->setIsp($body->asn->name);
$response->setOrganization($body->asn->name);
$response->setAs($body->asn->asn . ' ' . $body->asn->name);
$response->setAs($body->asn->asn.' '.$body->asn->name);

if (isset($body->carrier) && !empty($body->carrier)) {
$response->setMobile(true)
Expand Down
13 changes: 11 additions & 2 deletions src/Console/LookupUnknownIPsCommand.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\Console;

use Flarum\Database\AbstractModel;
Expand All @@ -18,8 +27,8 @@ class LookupUnknownIPsCommand extends Command
*/
private array $ipModels = [
AccessToken::class => 'last_ip_address',
Post::class => 'ip_address',
Draft::class => 'ip_address',
Post::class => 'ip_address',
Draft::class => 'ip_address',
];

protected $signature = 'fof:geoip:lookup';
Expand Down
4 changes: 2 additions & 2 deletions src/Model/IPInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ class IPInfo extends AbstractModel
'country_code', 'zip_code', 'latitude', 'longitude',
'isp', 'organization', 'as', 'mobile',
'threat_level', 'threat_types',
'error', 'data_provider'
'error', 'data_provider',
];

public $timestamps = true;

public $casts = [
'mobile' => 'boolean',
'mobile' => 'boolean',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
Expand Down

0 comments on commit f729a55

Please sign in to comment.