diff --git a/lib/Controller/CardApiController.php b/lib/Controller/CardApiController.php index 04d0fe4c9..ecec89a21 100644 --- a/lib/Controller/CardApiController.php +++ b/lib/Controller/CardApiController.php @@ -95,7 +95,7 @@ class CardApiController extends ApiController { * Update a card */ public function update($title, $type, $order = 0, $description = '', $owner, $duedate = null, $archived = null) { - $card = $this->cardService->update($this->request->getParam('cardId'), $title, $this->request->getParam('stackId'), $type, $order, $description, $owner, $duedate, 0, $archived); + $card = $this->cardService->update($this->request->getParam('cardId'), $title, $this->request->getParam('stackId'), $type, $owner, $description, $order, $duedate, 0, $archived); return new DataResponse($card, HTTP::STATUS_OK); } diff --git a/lib/Controller/CardController.php b/lib/Controller/CardController.php index b9238cb1d..b6f6e6958 100644 --- a/lib/Controller/CardController.php +++ b/lib/Controller/CardController.php @@ -95,7 +95,7 @@ class CardController extends Controller { * @return \OCP\AppFramework\Db\Entity */ public function update($id, $title, $stackId, $type, $order, $description, $duedate, $deletedAt) { - return $this->cardService->update($id, $title, $stackId, $type, $order, $description, $this->userId, $duedate, $deletedAt); + return $this->cardService->update($id, $title, $stackId, $type, $this->userId, $description, $order, $duedate, $deletedAt); } /** diff --git a/lib/Service/CardService.php b/lib/Service/CardService.php index 055fb8d8e..8b7d781cd 100644 --- a/lib/Service/CardService.php +++ b/lib/Service/CardService.php @@ -257,9 +257,9 @@ class CardService { * @param $title * @param $stackId * @param $type - * @param $order - * @param $description * @param $owner + * @param $description + * @param $order * @param $duedate * @return \OCP\AppFramework\Db\Entity * @throws StatusException @@ -268,7 +268,7 @@ class CardService { * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException * @throws BadRequestException */ - public function update($id, $title, $stackId, $type, $order = 0, $description = '', $owner, $duedate = null, $deletedAt = null, $archived = null) { + public function update($id, $title, $stackId, $type, $owner, $description = '', $order = 0, $duedate = null, $deletedAt = null, $archived = null) { if (is_numeric($id) === false) { throw new BadRequestException('card id must be a number'); } diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index d506c6c49..e52e90331 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $message !== null @@ -197,9 +197,6 @@ - - findAssignedCards - \OCP\AppFramework\Db\ diff --git a/tests/unit/Service/CardServiceTest.php b/tests/unit/Service/CardServiceTest.php index 890c87f0d..292913686 100644 --- a/tests/unit/Service/CardServiceTest.php +++ b/tests/unit/Service/CardServiceTest.php @@ -196,7 +196,7 @@ class CardServiceTest extends TestCase { $this->cardMapper->expects($this->once())->method('update')->willReturnCallback(function ($c) { return $c; }); - $actual = $this->cardService->update(123, 'newtitle', 234, 'text', 999, 'foo', 'admin', '2017-01-01 00:00:00', null); + $actual = $this->cardService->update(123, 'newtitle', 234, 'text', 'admin', 'foo', 999, '2017-01-01 00:00:00', null); $this->assertEquals('newtitle', $actual->getTitle()); $this->assertEquals(234, $actual->getStackId()); $this->assertEquals('text', $actual->getType()); @@ -212,7 +212,7 @@ class CardServiceTest extends TestCase { $this->cardMapper->expects($this->once())->method('find')->willReturn($card); $this->cardMapper->expects($this->never())->method('update'); $this->expectException(StatusException::class); - $this->cardService->update(123, 'newtitle', 234, 'text', 999, 'foo', 'admin', '2017-01-01 00:00:00', null, true); + $this->cardService->update(123, 'newtitle', 234, 'text', 'admin', 'foo', 999, '2017-01-01 00:00:00', null, true); } public function testRename() { diff --git a/tests/unit/controller/CardControllerTest.php b/tests/unit/controller/CardControllerTest.php index 6a8f87a7f..3effe1e62 100644 --- a/tests/unit/controller/CardControllerTest.php +++ b/tests/unit/controller/CardControllerTest.php @@ -75,7 +75,7 @@ class CardControllerTest extends TestCase { public function testUpdate() { $this->cardService->expects($this->once()) ->method('update') - ->with(1, 'title', 3, 'text', 5, 'foo', $this->userId, '2017-01-01 00:00:00') + ->with(1, 'title', 3, 'text', $this->userId, 'foo', 5, '2017-01-01 00:00:00') ->willReturn(1); $this->assertEquals(1, $this->controller->update(1, 'title', 3, 'text', 5, 'foo', '2017-01-01 00:00:00', null)); }