Skip to content

Commit a116982

Browse files
authored
chore: update dependencies (#53)
* chore: update dependencies * build: update PHP and Laravel versions in PHPUnit configuration
1 parent 31b486d commit a116982

File tree

8 files changed

+34
-30
lines changed

8 files changed

+34
-30
lines changed

.github/workflows/phpunit.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest]
16-
php: [8.1, 8.2, 8.3]
17-
laravel: [10.*, 11.*]
18-
include:
19-
- laravel: 10.*
20-
testbench: 8.*
21-
- laravel: 11.*
22-
testbench: 9.*
23-
exclude:
24-
- laravel: 11.*
25-
php: 8.1
16+
php: [8.2, 8.3, 8.4]
17+
laravel: [11.*, 12.*]
18+
# include:
19+
# - laravel: 10.*
20+
# testbench: 8.*
21+
# - laravel: 11.*
22+
# testbench: 9.*
23+
# exclude:
24+
# - laravel: 11.*
25+
# php: 8.1
2626

2727

2828
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.os }}
@@ -60,7 +60,6 @@ jobs:
6060
run: |
6161
composer --version
6262
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
63-
composer require "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --dev
6463
composer update --prefer-dist --no-interaction --no-suggest --dev
6564
composer dump
6665

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
},
2121
"require-dev": {
2222
"friendsofphp/php-cs-fixer": "^3",
23-
"larastan/larastan": "^2",
23+
"larastan/larastan": "^3",
2424
"orchestra/testbench": ">=9",
25-
"rector/rector": "^1.0"
25+
"rector/rector": "^2"
2626
},
2727
"autoload": {
2828
"psr-4": {

rector.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@
2727
earlyReturn: true,
2828
// strictBooleans: true,
2929
)
30-
->withRules([
31-
AddVoidReturnTypeWhereNoReturnRector::class,
32-
])
3330
->withCache(
3431
// ensure file system caching is used instead of in-memory
3532
cacheClass: FileCacheStorage::class,
36-
3733
// specify a path that works locally as well as on CI job runners
3834
cacheDirectory: '/tmp/rector'
3935
);

ruleset-phpstan.neon

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ parameters:
55
- src
66
- tests
77

8-
level: 7
8+
level: 6
99
reportStaticMethodSignatures: true
10+
noEnvCallsOutsideOfConfig: true
11+
viewDirectories:
12+
- resources/views
13+
1014
parallel:
1115
jobSize: 20
1216
maximumNumberOfProcesses: 32

src/Controllers/EnvController.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@
1414

1515
class EnvController extends BaseController
1616
{
17+
/**
18+
* @const view-string
19+
*/
20+
protected const INDEX_VIEW = ServiceProvider::PACKAGE.'::index';
21+
1722
public function __construct(
18-
protected EnvEditor $envEditor
23+
protected EnvEditor $envEditor,
1924
) {
2025
}
2126

@@ -31,7 +36,7 @@ public function index(Request $request)
3136
return $this->returnGenericResponse(true, ['items' => $envFileContent]);
3237
}
3338

34-
return view(ServiceProvider::PACKAGE.'::index', ['envValues' => $envFileContent]);
39+
return view(static::INDEX_VIEW, ['envValues' => $envFileContent]);
3540
}
3641

3742
/**
@@ -78,7 +83,7 @@ public function getBackupFiles(Request $request): View|JsonResponse
7883
return $this->returnGenericResponse(true, ['items' => $allBackUps]);
7984
}
8085

81-
return view(ServiceProvider::PACKAGE.'::index', ['backUpFiles' => $allBackUps]);
86+
return view(static::INDEX_VIEW, ['backUpFiles' => $allBackUps]);
8287
}
8388

8489
/**
@@ -158,7 +163,7 @@ protected function returnGenericResponse(
158163
bool $success,
159164
array $data = [],
160165
?string $translationWord = null,
161-
string $keyName = ''
166+
string $keyName = '',
162167
): JsonResponse {
163168
if ($translationWord && $success) {
164169
$data = array_merge($data, [

src/Dto/EntryObj.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(
1818
protected mixed $value,
1919
public readonly int $group,
2020
public readonly int $index,
21-
protected bool $isSeparator = false
21+
protected bool $isSeparator = false,
2222
) {
2323
}
2424

src/Facades/EnvEditor.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22

33
namespace GeoSot\EnvEditor\Facades;
44

5+
use GeoSot\EnvEditor\Dto\BackupObj;
6+
use GeoSot\EnvEditor\Dto\EntryObj;
57
use Illuminate\Http\UploadedFile;
68
use Illuminate\Support\Collection;
79
use Illuminate\Support\Facades\Facade;
810
use Symfony\Component\HttpFoundation\File\File;
911

1012
/**
11-
* @method static Collection getEnvFileContent(string $fileName = '')
13+
* @method static Collection<int, EntryObj> getEnvFileContent(string $fileName = '')
1214
* @method static bool keyExists(string $key)
1315
* @method static mixed getKey(string $key, $default = null)
14-
* @method static bool addKey(string $key, $value, array $options = [])
16+
* @method static bool addKey(string $key, $value, array<string, int|string> $options = [])
1517
* @method static bool editKey(string $keyToChange, $newValue)
1618
* @method static bool deleteKey(string $key)
17-
* @method static Collection getAllBackUps()
19+
* @method static Collection<int, BackupObj> getAllBackUps()
1820
* @method static File upload(UploadedFile $uploadedFile, bool $replaceCurrentEnv)
1921
* @method static bool backUpCurrent()
2022
* @method static string getFilePath(string $fileName = '')

src/ServiceProvider.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
class ServiceProvider extends \Illuminate\Support\ServiceProvider
99
{
10-
public const VENDOR = 'geo-sv';
11-
1210
public const PACKAGE = 'env-editor';
1311

1412
public const TRANSLATE_PREFIX = self::PACKAGE.'::env-editor.';
@@ -32,7 +30,7 @@ public function register(): void
3230
static::PACKAGE
3331
);
3432

35-
$this->app->singleton(EnvEditor::class, fn (): \GeoSot\EnvEditor\EnvEditor => new EnvEditor(
33+
$this->app->singleton(EnvEditor::class, fn (): EnvEditor => new EnvEditor(
3634
new Repository(config(static::PACKAGE)),
3735
$this->app->make(Filesystem::class)
3836
));
@@ -43,7 +41,7 @@ public function register(): void
4341
private function loadResources(): void
4442
{
4543
$this->loadRoutesFrom(__DIR__.'/../routes/routes.php');
46-
$this->loadViewsFrom(__DIR__.'/../resources/views', static::PACKAGE);
44+
$this->loadViewsFrom(__DIR__.'/../resources/views', 'env-editor');
4745
$this->loadTranslationsFrom(__DIR__.'/../resources/lang', static::PACKAGE);
4846
}
4947

0 commit comments

Comments
 (0)