Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mansoorkhan96 committed Aug 3, 2024
1 parent ac36a4e commit 00f697d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
uses: ramsey/composer-install@v2

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
run: composer analyse
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
"orchestra/testbench": "^8.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-arch": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0"
"pestphp/pest-plugin-laravel": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
15 changes: 15 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ parameters:

-
message: "#^Cannot access property \\$firstVersion on Illuminate\\\\Database\\\\Eloquent\\\\Model\\|int\\|string\\.$#"
count: 2
path: src/RevisionsPage.php

-
message: "#^Cannot access property \\$lastVersion on Illuminate\\\\Database\\\\Eloquent\\\\Model\\|int\\|string\\.$#"
count: 1
path: src/RevisionsPage.php

Expand All @@ -60,6 +65,16 @@ parameters:
count: 1
path: src/RevisionsPage.php

-
message: "#^Method Mansoor\\\\FilamentVersionable\\\\RevisionsPage\\:\\:diff\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/RevisionsPage.php

-
message: "#^Method Mansoor\\\\FilamentVersionable\\\\RevisionsPage\\:\\:revisionsList\\(\\) return type with generic class Illuminate\\\\Pagination\\\\LengthAwarePaginator does not specify its types\\: TValue$#"
count: 1
path: src/RevisionsPage.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:versions\\(\\)\\.$#"
count: 2
Expand Down
3 changes: 0 additions & 3 deletions src/RevisionsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ public function diff(): array
);
}

/** @phpstan-ignore-next-line */
#[Computed]
public function revisionsList(): LengthAwarePaginator
{
return $this->record
->versions()
/** @phpstan-ignore-next-line */
->whereNot('id', $this->record->firstVersion->id)
->with('user')
->latest()
Expand All @@ -95,7 +93,6 @@ public function nextVersionAction(): Action
{
return Action::make('nextVersion')
->label(__('filament-versionable::actions.next_version'))
/** @phpstan-ignore-next-line */
->disabled(fn () => $this->version->is($this->record->lastVersion))
->action(fn () => $this->nextVersion());
}
Expand Down

0 comments on commit 00f697d

Please sign in to comment.