Skip to content

Commit d17c679

Browse files
committed
chore: stan, rector and pint
1 parent 0c2b587 commit d17c679

File tree

5 files changed

+26
-18
lines changed

5 files changed

+26
-18
lines changed

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
includes:
2-
- ./vendor/nunomaduro/larastan/extension.neon
2+
- ./vendor/larastan/larastan/extension.neon
33

44
parameters:
55

rector.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
6+
use Rector\Config\RectorConfig;
7+
use Rector\Set\ValueObject\LevelSetList;
8+
9+
return static function (RectorConfig $rectorConfig): void {
10+
$rectorConfig->paths([
11+
__DIR__.'/src',
12+
__DIR__.'/tests',
13+
]);
14+
15+
// register a single rule
16+
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
17+
18+
// define sets of rules
19+
$rectorConfig->sets([
20+
LevelSetList::UP_TO_PHP_82,
21+
]);
22+
};

src/Jobs/DataTableExportJob.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,15 @@ class DataTableExportJob implements ShouldBeUnique, ShouldQueue
4343

4444
public array $attributes = [];
4545

46-
public array $request = [];
47-
48-
public string $sheetName = '';
49-
50-
/**
51-
* @var int|string
52-
*/
53-
public $user;
54-
5546
/**
5647
* Create a new job instance.
5748
*
5849
* @param int|string $user
5950
*/
60-
public function __construct(array $dataTable, array $request, $user, string $sheetName = 'Sheet1')
51+
public function __construct(array $dataTable, public array $request, public $user, public string $sheetName = 'Sheet1')
6152
{
6253
$this->dataTable = $dataTable[0];
6354
$this->attributes = $dataTable[1];
64-
$this->request = $request;
65-
$this->user = $user;
66-
$this->sheetName = $sheetName;
6755
}
6856

6957
/**

src/Livewire/ExportButtonComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ExportButtonComponent extends Component
1717
{
1818
public string $class = 'btn btn-primary';
1919

20-
public ?string $tableId;
20+
public ?string $tableId = null;
2121

2222
public ?string $emailTo = '';
2323

tests/ExportTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ protected function setUp(): void
2424
parent::setUp();
2525

2626
$router = $this->app['router'];
27-
$router->get('/users', function (UsersDataTable $dataTable) {
28-
return $dataTable->render('tests::users');
29-
});
27+
$router->get('/users', fn (UsersDataTable $dataTable) => $dataTable->render('tests::users'));
3028
}
3129
}

0 commit comments

Comments
 (0)