Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeHint Fixes #1750

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"laravel/pint": "^1.10",
"monolog/monolog": "*",
"nunomaduro/collision": "^6.0|^7.0|^8.0",
"nunomaduro/larastan": "^2.6",
"larastan/larastan": "^2.6",
"orchestra/testbench": "^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.0|^10.0|^11.0"
},
Expand Down
6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
includes:
- vendor/nunomaduro/larastan/extension.neon
- vendor/larastan/larastan/extension.neon

parameters:
paths:
Expand All @@ -10,11 +10,11 @@ parameters:
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false
treatPhpDocTypesAsCertain: false
reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
- identifier: missingType.generics
- identifier: missingType.iterableValue
- '#Access to an undefined property Rappasoft\\LaravelLivewireTables\\Views\\Column\:\:\$view#'
- "#Unsafe usage of new static#"
- '#on array\<string, non-empty-array\<int\<0, max\>, mixed\>\> in empty\(\) does not exist.#'
Expand Down
2 changes: 1 addition & 1 deletion src/LaravelLivewireTablesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function boot(): void

}

public function consoleCommands()
public function consoleCommands(): void
{
if ($this->app->runningInConsole()) {

Expand Down
4 changes: 2 additions & 2 deletions src/Traits/Helpers/TableAttributeHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ public function hasTableRowUrl(): bool
return $this->trUrlCallback !== null;
}

public function getTableRowUrl($row): ?string
public function getTableRowUrl(int|Model $row): ?string
{
return $this->trUrlCallback ? call_user_func($this->trUrlCallback, $row) : null;
}

public function getTableRowUrlTarget($row): ?string
public function getTableRowUrlTarget(int|Model $row): ?string
{
return $this->trUrlTargetCallback ? call_user_func($this->trUrlTargetCallback, $row) : null;
}
Expand Down
6 changes: 2 additions & 4 deletions tests/Views/Columns/LinkColumnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ public function test_can_render_field_if_title_and_location_callback(): void
$this->assertNotEmpty($column);
}

/** @test */
public function can_check_ishtml_from_html_column(): void
public function test_can_check_ishtml_from_html_column(): void
{
$column = LinkColumn::make('Name', 'name')
->title(fn ($row) => 'Title')
Expand All @@ -55,8 +54,7 @@ public function can_check_ishtml_from_html_column(): void
$this->assertTrue($column->isHtml());
}

/** @test */
public function can_get_html_from_html_label_column(): void
public function test_can_get_html_from_html_label_column(): void
{
$column = LinkColumn::make('Name', 'name')
->title(fn ($row) => '<strong>My Label</strong>')
Expand Down
Loading