This commit is contained in:
philipp lang 2024-06-27 10:52:45 +02:00
parent 45597558e3
commit 4cfa70e534
6 changed files with 15 additions and 7 deletions

View File

@ -11,6 +11,9 @@ class FileshareStoreAction
{
use AsAction;
/**
* @return array<string, mixed>
*/
public function rules(): array
{
return [
@ -20,7 +23,7 @@ class FileshareStoreAction
];
}
public function asController(ActionRequest $request)
public function asController(ActionRequest $request): void
{
$type = $request->input('type')::from($request->input('config'));

View File

@ -5,13 +5,14 @@ namespace App\Fileshare\Actions;
use App\Fileshare\Models\FileshareConnection;
use App\Fileshare\Resources\FileshareConnectionResource;
use Inertia\Inertia;
use Inertia\Response;
use Lorisleiva\Actions\Concerns\AsAction;
class IndexAction
{
use AsAction;
public function handle()
public function handle(): Response
{
session()->put('menu', 'setting');
session()->put('title', 'Datei-Verbindungen');

View File

@ -2,8 +2,12 @@
namespace App\Fileshare\Resources;
use App\Fileshare\Models\FileshareConnection;
use Illuminate\Http\Resources\Json\JsonResource;
/**
* @mixin FileshareConnection
*/
class FileshareConnectionResource extends JsonResource
{
/**

View File

@ -14,7 +14,7 @@ class FileshareConnectionFactory extends Factory
/**
* The name of the factory's corresponding model.
*
* @var string
* @var class-string<FileshareConnection>
*/
protected $model = FileshareConnection::class;

View File

@ -10,8 +10,8 @@ abstract class FileshareTestCase extends TestCase
{
use DatabaseTransactions;
protected $adminUser = 'admin';
protected $adminPassword = 'admin';
protected string $adminUser = 'admin';
protected string $adminPassword = 'admin';
public function setUp(): void
{

View File

@ -34,7 +34,7 @@ abstract class TestCase extends BaseTestCase
$this->initInertiaTestcase();
}
public function loginNami(int $mglnr = 12345, string $password = 'password', int|Group $groupId = 55): self
public function loginNami(int $mglnr = 12345, string $password = 'password', int|Group $groupId = 55): static
{
Auth::success($mglnr, $password);
$group = is_int($groupId)
@ -57,7 +57,7 @@ abstract class TestCase extends BaseTestCase
return $this;
}
public function login(): self
public function login(): static
{
$this->be($user = User::factory()->create());
$this->me = $user;