Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkitjalan committed Aug 22, 2024
1 parent b7b87fd commit cf20abb
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
},
"require-dev": {
"mockery/mockery": "^1.6",
"pestphp/pest": "^1.20|^2.0"
"pestphp/pest": "^1.20|^2.0",
"illuminate/foundaition": "^10.0|^11.0"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 3 additions & 3 deletions src/Console/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace PulkitJalan\IPGeoLocation\Console;

use Illuminate\Console\Command;
use PulkitJalan\IPGeoLocation\IpGeolocationUpdater;
use PulkitJalan\IPGeoLocation\IPGeolocationUpdater;
use PulkitJalan\IPGeoLocation\Exceptions\InvalidDatabaseException;
use PulkitJalan\IPGeoLocation\Exceptions\InvalidCredentialsException;

Expand All @@ -24,7 +24,7 @@ class UpdateCommand extends Command
protected $description = 'Update ip geolocation database files to the latest version';

/**
* @var \PulkitJalan\IPGeoLocation\IpGeolocationUpdater
* @var \PulkitJalan\IPGeoLocation\IPGeolocationUpdater
*/
protected $geoIPUpdater;

Expand All @@ -35,7 +35,7 @@ public function __construct(array $config)
{
parent::__construct();

$this->geoIPUpdater = new IpGeolocationUpdater($config);
$this->geoIPUpdater = new IPGeolocationUpdater($config);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/IPGeoLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class IPGeoLocation
*/
public function __construct(array $config = ['driver' => 'ip-api'], GuzzleClient $guzzle = null)
{
$this->driver = with(new IpGeolocationManager($config, $guzzle))->getDriver();
$this->driver = with(new IPGeolocationManager($config, $guzzle))->getDriver();
$this->random = Arr::get($config, 'random', false);
}

Expand Down
2 changes: 1 addition & 1 deletion src/IpGeolocationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use PulkitJalan\IPGeoLocation\Drivers\MaxmindDatabaseDriver;
use PulkitJalan\IPGeoLocation\Exceptions\InvalidDriverException;

class IpGeolocationManager
class IPGeolocationManager
{
/**
* @var array
Expand Down
2 changes: 1 addition & 1 deletion src/IpGeolocationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Illuminate\Support\ServiceProvider;
use PulkitJalan\IPGeoLocation\Console\UpdateCommand;

class IpGeolocationServiceProvider extends ServiceProvider
class IPGeolocationServiceProvider extends ServiceProvider
{
/**
* Boot the service provider.
Expand Down
2 changes: 1 addition & 1 deletion src/IpGeolocationUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use PulkitJalan\IPGeoLocation\Exceptions\InvalidDatabaseException;
use PulkitJalan\IPGeoLocation\Exceptions\InvalidCredentialsException;

class IpGeolocationUpdater
class IPGeolocationUpdater
{
/**
* @var array
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Client as GuzzleClient;
use PulkitJalan\IPGeoLocation\IpGeolocationUpdater;
use PulkitJalan\IPGeoLocation\IPGeolocationUpdater;
use PulkitJalan\IPGeoLocation\Exceptions\InvalidDatabaseException;
use PulkitJalan\IPGeoLocation\Exceptions\InvalidCredentialsException;

test('no database', function () {
$this->expectException(InvalidDatabaseException::class);

(new IpGeolocationUpdater([]))->update();
(new IPGeolocationUpdater([]))->update();
});

test('no license key', function () {
Expand All @@ -23,7 +23,7 @@
],
];

(new IpGeolocationUpdater($config))->update();
(new IPGeolocationUpdater($config))->update();
});

test('maxmind updater', function () {
Expand Down Expand Up @@ -51,7 +51,7 @@
->withSomeOfArgs('https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&suffix=tar.gz&license_key=test')
->andReturn(new Response);

$geoipUpdater = new IpGeolocationUpdater($config, $client);
$geoipUpdater = new IPGeolocationUpdater($config, $client);

expect($database)->toEqual($geoipUpdater->update());

Expand All @@ -77,7 +77,7 @@
->withSomeOfArgs('http://example.com/maxmind_database.mmdb.gz?license_key=test')
->andThrow(new Exception);

$geoipUpdater = new IpGeolocationUpdater($config, $client);
$geoipUpdater = new IPGeolocationUpdater($config, $client);

expect($geoipUpdater->update())->toBeFalse();
});

0 comments on commit cf20abb

Please sign in to comment.