Skip to content

Commit b17ef31

Browse files
committed
chore: bump interaction-design-foundation/coding-standard to ^1.0-RC1
Apply resulting php-cs-fixer changes.
1 parent 273c0c0 commit b17ef31

18 files changed

Lines changed: 23 additions & 48 deletions

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"require-dev": {
2323
"geoip2/geoip2": "^3.0",
24-
"interaction-design-foundation/coding-standard": "^0.7",
24+
"interaction-design-foundation/coding-standard": "^1.0-RC1",
2525
"orchestra/testbench": "^10.0 || ^11.0",
2626
"phpstan/phpstan": "^2.1",
2727
"phpunit/phpunit": "^11.0 || ^12.0",

src/Cache.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
use Illuminate\Cache\CacheManager;
66

7-
/**
8-
* @psalm-import-type LocationArray from \InteractionDesignFoundation\GeoIP\Location
9-
*/
7+
/** @psalm-import-type LocationArray from \InteractionDesignFoundation\GeoIP\Location */
108
final class Cache
119
{
1210
/**

src/Console/Clear.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function isSupported(): bool
4141
* Flush the cache.
4242
* @return void
4343
*/
44-
protected function performFlush()
44+
protected function performFlush(): void
4545
{
4646
$this->output->write('Clearing cache...');
4747

src/Contracts/ServiceInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
use InteractionDesignFoundation\GeoIP\Location;
66

7-
/**
8-
* @psalm-import-type LocationArray from \InteractionDesignFoundation\GeoIP\Location
9-
*/
7+
/** @psalm-import-type LocationArray from \InteractionDesignFoundation\GeoIP\Location */
108
interface ServiceInterface
119
{
1210
/** The "booting" method of the service. */

src/Exceptions/MissingConfigurationException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
namespace InteractionDesignFoundation\GeoIP\Exceptions;
44

5-
use RuntimeException;
6-
7-
final class MissingConfigurationException extends RuntimeException {}
5+
final class MissingConfigurationException extends \RuntimeException {}

src/GeoIP.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
use League\ISO3166\ISO3166;
99
use Psr\Log\LoggerInterface;
1010

11-
/**
12-
* @psalm-import-type LocationArray from \InteractionDesignFoundation\GeoIP\Location
13-
*/
11+
/** @psalm-import-type LocationArray from \InteractionDesignFoundation\GeoIP\Location */
1412
final class GeoIP
1513
{
1614
/**

src/Location.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace InteractionDesignFoundation\GeoIP;
44

5-
use ArrayAccess;
65
use Illuminate\Support\Arr;
76
use Illuminate\Support\Str;
87

@@ -41,7 +40,7 @@
4140
* }
4241
* @template-implements \ArrayAccess<string, mixed>
4342
*/
44-
final class Location implements ArrayAccess
43+
final class Location implements \ArrayAccess
4544
{
4645
/**
4746
* Create a new location instance.

src/Services/AbstractService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function __construct(protected array $config = [])
1515
}
1616

1717
/** The "booting" method of the service. */
18-
public function boot(): void {}
18+
final public function boot(): void {}
1919

2020
/** {@inheritDoc} */
2121
#[\Override]
@@ -48,7 +48,7 @@ final public function ensureConfigurationParameterDefined(string | array $keys):
4848
foreach ($keys as $key) {
4949
// If the config is not defined / is empty.
5050
if (empty($this->config($key))) {
51-
$service = (new \ReflectionClass($this))->getShortName();
51+
$service = new \ReflectionClass($this)->getShortName();
5252

5353
throw new MissingConfigurationException(sprintf("Missing '%s' parameter (service: %s)", $key, $service));
5454
}

src/Services/IPData.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
namespace InteractionDesignFoundation\GeoIP\Services;
44

5-
use Exception;
65
use Illuminate\Support\Arr;
76
use InteractionDesignFoundation\GeoIP\Support\HttpClient;
87

9-
/**
10-
* @psalm-api
11-
*/
8+
/** @psalm-api */
129
final class IPData extends AbstractService
1310
{
1411
/**
@@ -43,7 +40,7 @@ public function locate($ip): \InteractionDesignFoundation\GeoIP\Location
4340

4441
// Verify server response
4542
if ($this->client->getErrors() !== null || empty($data[0])) {
46-
throw new Exception('Request failed ('.$this->client->getErrors().')');
43+
throw new \Exception('Request failed ('.$this->client->getErrors().')');
4744
}
4845

4946
$json = json_decode((string) $data[0], true);

src/Services/IPFinder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
use InteractionDesignFoundation\GeoIP\Support\HttpClient;
66

7-
/**
8-
* @psalm-api
9-
*/
7+
/** @psalm-api */
108
final class IPFinder extends AbstractService
119
{
1210
/**

0 commit comments

Comments
 (0)