refactor: Fix psalm issues

- Add typing for most of the services, controllers and mappers
- Add api doc for mappers
- Use vendor-bin for psalm
- Use attributes for controllers
- Fix upload of attachments

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
This commit is contained in:
Carl Schwan
2025-09-23 16:59:09 +02:00
parent 64741e455d
commit 5cf486150a
77 changed files with 4257 additions and 1393 deletions

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2016 Julius Härtl <jus@bitgrid.net>
*
@@ -48,8 +50,7 @@ use Test\TestCase;
*/
class StackServiceTest extends TestCase {
/** @var StackService */
private $stackService;
private StackService $stackService;
/** @var \PHPUnit\Framework\MockObject\MockObject|StackMapper */
private $stackMapper;
/** @var \PHPUnit\Framework\MockObject\MockObject|CardMapper */
@@ -251,6 +252,9 @@ class StackServiceTest extends TestCase {
$this->stackMapper->expects($this->once())
->method('findAll')
->willReturn($stacks);
$this->stackMapper->expects($this->any())
->method('update')
->willReturnCallback(fn (Stack $stack): Stack => $stack);
$actual = $this->stackService->reorder(1, 2);
$a = $this->createStack(1, 2);
$b = $this->createStack(2, 0);
@@ -259,7 +263,7 @@ class StackServiceTest extends TestCase {
$this->assertEquals($expected, $actual);
}
private function createStack($id, $order) {
private function createStack(int $id, int $order) {
$stack = new Stack();
$stack->setId($id);
$stack->setBoardId(1);