Skip to content

Commit e897e20

Browse files
committed
debug phpstan
use non-dist
1 parent c149c9a commit e897e20

File tree

7 files changed

+18
-7
lines changed

7 files changed

+18
-7
lines changed

.github/workflows/phpstan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ jobs:
2222
- name: Install composer dependencies
2323
uses: ramsey/composer-install@v3
2424

25+
- name: Show PHPStan diagnose
26+
run: ./vendor/bin/phpstan diagnose
27+
2528
- name: Run PHPStan
2629
run: ./vendor/bin/phpstan --error-format=github

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ build
44
composer.lock
55
coverage
66
docs
7-
phpunit.xml
8-
phpstan.neon
97
testbench.yaml
108
vendor
119
node_modules

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"nunomaduro/collision": "^8.6.1",
2929
"orchestra/testbench": "^9.11 || ^10.1",
3030
"phpstan/extension-installer": "^1.4.3",
31+
"phpstan/phpstan": "^2.1.8",
3132
"phpstan/phpstan-deprecation-rules": "^2.0.1",
3233
"phpstan/phpstan-phpunit": "^2.0.4",
3334
"phpstan/phpstan-strict-rules": "^2.0.3",
File renamed without changes.
File renamed without changes.

src/Commands/DeleteCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ public function __construct(
2323

2424
public function handle(): int
2525
{
26-
if (! $this->option('force') && ! $this->confirm('Do you want to proceed? (y/N)', false)) {
26+
/** @var bool $force */
27+
$force = $this->option('force');
28+
if (! $force && ! $this->confirm('Do you want to proceed? (y/N)', false)) {
2729
return self::SUCCESS;
2830
}
2931

src/Commands/IndexCommand.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ public function __construct(
2525

2626
public function handle(): int
2727
{
28+
/** @var array<int,string> $indices */
29+
$indices = $this->argument('index');
2830
foreach ($this->indexRepository->all() as $indexConfig) {
2931
if (
30-
! empty($this->argument('index'))
31-
&& ! in_array($indexConfig->getName(), $this->argument('index'), true)
32+
! empty($indices)
33+
&& ! in_array($indexConfig->getName(), $indices, true)
3234
) {
3335
continue;
3436
}
@@ -37,7 +39,9 @@ public function handle(): int
3739

3840
$lock = $indexConfig->indexingLock();
3941

40-
if ($this->option('force')) {
42+
/** @var bool $force */
43+
$force = $this->option('force');
44+
if ($force) {
4145
$lock->forceRelease();
4246
}
4347

@@ -49,9 +53,12 @@ public function handle(): int
4953

5054
$indexConfigKey = $indexConfig::class;
5155

56+
/** @var bool $delete */
57+
$delete = $this->option('delete');
58+
5259
Bus::batch([
5360
[
54-
new SetupIndex($indexConfigKey, $this->option('delete')),
61+
new SetupIndex($indexConfigKey, $delete),
5562
new PopulateIndex($indexConfigKey),
5663
],
5764
])

0 commit comments

Comments
 (0)