Skip to content

Commit a1046fc

Browse files
committed
refactor: Run pint
1 parent 1c8eb45 commit a1046fc

File tree

322 files changed

+2740
-2387
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+2740
-2387
lines changed

app/Console/Commands/SC/ImportItems.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public function handle(): int
4949

5050
$files = File::allFiles(scdata('items')) + Storage::allFiles(scdata('ships'));
5151

52+
// Debug
53+
// $files = collect($files)->filter(fn ($file) => $file->isFile() && str_contains($file->getFilename(), 'behr_pistol'));
54+
5255
if ($this->option('skipItems') === false) {
5356
collect($files)
5457
->filter(function (string $file) {

app/Services/Parser/CommLink/Content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(Crawler $commLinkDocument)
4747
*/
4848
public function getContent(): string
4949
{
50-
$content = ContentExtractorFactory::getParserFromCrawler($this->commLink)->getContent();
50+
$content = ContentExtractorFactory::getParserFromCrawler($this->commLink)?->getContent();
5151

5252
return empty($content) ? '' : $this->cleanContent($content);
5353
}

app/Services/Parser/CommLink/Content/ContentExtractorFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
class ContentExtractorFactory
1010
{
1111
/**
12-
* @return ContentExtractorInterface The parser matching the most elements
12+
* @return ContentExtractorInterface|null The parser matching the most elements
1313
*/
14-
public static function getParserFromCrawler(Crawler $crawler): ContentExtractorInterface
14+
public static function getParserFromCrawler(Crawler $crawler): ?ContentExtractorInterface
1515
{
1616
return collect(
1717
[

app/Services/Parser/SC/AbstractCommodityItem.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ protected function getDescriptionText(string $description): string
113113

114114
protected function getName(array $attachDef, string $default): string
115115
{
116-
$key = substr($attachDef['Localization']['Name'], 1);
116+
$key = substr($attachDef['Localization']['__Name'], 1);
117117
if (str_contains($key, '_Desc_')) {
118118
$key = str_replace('_Desc_', '_Name_', $key);
119119
}
@@ -126,7 +126,7 @@ protected function getName(array $attachDef, string $default): string
126126

127127
protected function getDescriptionKey(array $attachDef): string
128128
{
129-
return substr($attachDef['Localization']['Description'], 1);
129+
return substr($attachDef['Localization']['__Description'], 1);
130130
}
131131

132132
protected function getDescription(array $attachDef, string $locale = 'en'): string
@@ -148,7 +148,8 @@ protected function getManufacturer(array $attachDef, Collection $manufacturers):
148148
'code' => 'UNKN',
149149
'uuid' => '00000000-0000-0000-0000-000000000000',
150150
];
151-
$manufacturer = $manufacturers->get($attachDef['Manufacturer'], $default);
151+
152+
$manufacturer = $manufacturers->get($attachDef['Manufacturer']['__ref'] ?? $attachDef['Manufacturer'], $default);
152153

153154
if ($manufacturer['name'] === '@LOC_PLACEHOLDER') {
154155
$manufacturer = $default;

app/Services/Parser/SC/VehicleItems/Weapon.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ private static function buildModesPart($weapon): array
5050

5151
$modes = collect($weapon['Weapon']['Modes'])
5252
->map(function (array $mode) {
53-
5453
return [
5554
'mode' => $mode['Name'],
5655
'localised' => $mode['LocalisedName'],

config/api.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types = 1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
return [
46
'wiki_url' => env('WIKI_URL', 'http://localhost'),

config/auth.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types = 1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
return [
46

config/cache.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,36 +41,36 @@
4141
],
4242

4343
'database' => [
44-
'driver' => 'database',
45-
'table' => 'cache',
44+
'driver' => 'database',
45+
'table' => 'cache',
4646
'connection' => null,
4747
],
4848

4949
'file' => [
5050
'driver' => 'file',
51-
'path' => storage_path('framework/cache'),
51+
'path' => storage_path('framework/cache'),
5252
],
5353

5454
'memcached' => [
55-
'driver' => 'memcached',
55+
'driver' => 'memcached',
5656
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
57-
'sasl' => [
57+
'sasl' => [
5858
env('MEMCACHED_USERNAME'),
5959
env('MEMCACHED_PASSWORD'),
6060
],
61-
'options' => [// Memcached::OPT_CONNECT_TIMEOUT => 2000,
61+
'options' => [// Memcached::OPT_CONNECT_TIMEOUT => 2000,
6262
],
63-
'servers' => [
63+
'servers' => [
6464
[
65-
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
66-
'port' => env('MEMCACHED_PORT', 11211),
65+
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
66+
'port' => env('MEMCACHED_PORT', 11211),
6767
'weight' => 100,
6868
],
6969
],
7070
],
7171

7272
'redis' => [
73-
'driver' => 'redis',
73+
'driver' => 'redis',
7474
'connection' => 'default',
7575
],
7676

config/database.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types = 1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
return [
46

config/logging.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,39 +33,39 @@
3333

3434
'channels' => [
3535
'stack' => [
36-
'driver' => 'stack',
36+
'driver' => 'stack',
3737
'channels' => ['daily'],
3838
],
3939

4040
'single' => [
4141
'driver' => 'single',
42-
'path' => storage_path('logs/laravel.log'),
43-
'level' => 'debug',
42+
'path' => storage_path('logs/laravel.log'),
43+
'level' => 'debug',
4444
],
4545

4646
'daily' => [
4747
'driver' => 'daily',
48-
'path' => storage_path('logs/laravel.log'),
48+
'path' => storage_path('logs/laravel.log'),
4949
'level' => env('LOG_LEVEL', 'info'),
50-
'days' => 7,
50+
'days' => 7,
5151
],
5252

5353
'slack' => [
54-
'driver' => 'slack',
55-
'url' => env('LOG_SLACK_WEBHOOK_URL'),
54+
'driver' => 'slack',
55+
'url' => env('LOG_SLACK_WEBHOOK_URL'),
5656
'username' => 'Laravel Log',
57-
'emoji' => ':boom:',
58-
'level' => 'critical',
57+
'emoji' => ':boom:',
58+
'level' => 'critical',
5959
],
6060

6161
'syslog' => [
6262
'driver' => 'syslog',
63-
'level' => 'debug',
63+
'level' => 'debug',
6464
],
6565

6666
'errorlog' => [
6767
'driver' => 'errorlog',
68-
'level' => 'debug',
68+
'level' => 'debug',
6969
],
7070
],
7171

0 commit comments

Comments
 (0)