diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 2f8f4c0..2640c4c 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -21,6 +21,8 @@ use Modules\Kanban\Models\CardType; use Modules\Kanban\Models\KanbanBoard; use Modules\Kanban\Models\KanbanBoardMapper; use Modules\Kanban\Models\KanbanCard; +use Modules\Kanban\Models\KanbanCardComment; +use Modules\Kanban\Models\KanbanCardCommentMapper; use Modules\Kanban\Models\KanbanCardMapper; use Modules\Kanban\Models\KanbanColumn; use Modules\Kanban\Models\KanbanColumnMapper; @@ -29,8 +31,6 @@ use phpOMS\Message\NotificationLevel; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; use phpOMS\Model\Message\FormValidation; -use Modules\Kanban\Models\KanbanCardComment; -use Modules\Kanban\Models\KanbanCardCommentMapper; /** * Kanban controller class. @@ -84,8 +84,8 @@ final class ApiController extends Controller */ public function createKanbanCardFromRequest(RequestAbstract $request) : KanbanCard { - $card = new KanbanCard(); - $card->name = (string) ($request->getData('title')); + $card = new KanbanCard(); + $card->name = (string) ($request->getData('title')); $card->description = (string) ($request->getData('plain') ?? ''); $card->setColumn((int) $request->getData('column')); $card->setOrder((int) ($request->getData('order') ?? 1)); @@ -164,7 +164,7 @@ final class ApiController extends Controller */ public function createKanbanCardCommentFromRequest(RequestAbstract $request) : KanbanCardComment { - $comment = new KanbanCardComment(); + $comment = new KanbanCardComment(); $comment->description = (string) ($request->getData('plain') ?? ''); $comment->setCard((int) $request->getData('card')); $comment->createdBy = new NullAccount($request->header->account); @@ -231,8 +231,8 @@ final class ApiController extends Controller */ public function createKanbanBoardFromRequest(RequestAbstract $request) : KanbanBoard { - $board = new KanbanBoard(); - $board->name = (string) $request->getData('title'); + $board = new KanbanBoard(); + $board->name = (string) $request->getData('title'); $board->description = (string) ($request->getData('plain') ?? ''); $board->setOrder((int) ($request->getData('order') ?? 1)); $board->setStatus((int) ($request->getData('status') ?? BoardStatus::ACTIVE)); @@ -303,7 +303,7 @@ final class ApiController extends Controller */ public function createKanbanColumnFromRequest(RequestAbstract $request) : KanbanColumn { - $column = new KanbanColumn(); + $column = new KanbanColumn(); $column->name = (string) $request->getData('title'); $column->setBoard((int) $request->getData('board')); $column->setOrder((int) ($request->getData('order') ?? 1)); diff --git a/tests/Models/1KanbanBoardMapperTest.php b/tests/Models/1KanbanBoardMapperTest.php index 82365f1..fa94575 100755 --- a/tests/Models/1KanbanBoardMapperTest.php +++ b/tests/Models/1KanbanBoardMapperTest.php @@ -32,9 +32,9 @@ class KanbanBoardMapperTest extends \PHPUnit\Framework\TestCase { $board = new KanbanBoard(); - $board->name = 'Test Board 0'; + $board->name = 'Test Board 0'; $board->description = 'This is some description'; - $board->createdBy = new NullAccount(1); + $board->createdBy = new NullAccount(1); $id = KanbanBoardMapper::create($board); self::assertGreaterThan(0, $board->getId()); @@ -60,9 +60,9 @@ class KanbanBoardMapperTest extends \PHPUnit\Framework\TestCase $text = new Text(); $board = new KanbanBoard(); - $board->name = $text->generateText(\mt_rand(3, 7)); + $board->name = $text->generateText(\mt_rand(3, 7)); $board->description = $text->generateText(\mt_rand(20, 70)); - $board->createdBy = new NullAccount(1); + $board->createdBy = new NullAccount(1); $id = KanbanBoardMapper::create($board); } diff --git a/tests/Models/4KanbanCardMapperTest.php b/tests/Models/4KanbanCardMapperTest.php index 428d1db..8be3cbd 100755 --- a/tests/Models/4KanbanCardMapperTest.php +++ b/tests/Models/4KanbanCardMapperTest.php @@ -34,7 +34,7 @@ class KanbanCardMapperTest extends \PHPUnit\Framework\TestCase { $card = new KanbanCard(); - $card->name = 'Some Card name'; + $card->name = 'Some Card name'; $card->description = 'This is some card description'; $card->setStatus(CardStatus::ACTIVE); $card->setType(CardType::TEXT); @@ -93,7 +93,7 @@ class KanbanCardMapperTest extends \PHPUnit\Framework\TestCase $text = new Text(); $card = new KanbanCard(); - $card->name = $text->generateText(\mt_rand(3, 7)); + $card->name = $text->generateText(\mt_rand(3, 7)); $card->description = $text->generateText(\mt_rand(20, 100)); $card->setStatus(CardStatus::ACTIVE); $card->setType(CardType::TEXT); diff --git a/tests/Models/KanbanBoardTest.php b/tests/Models/KanbanBoardTest.php index 821f433..bb51771 100755 --- a/tests/Models/KanbanBoardTest.php +++ b/tests/Models/KanbanBoardTest.php @@ -48,7 +48,7 @@ class KanbanBoardTest extends \PHPUnit\Framework\TestCase { $board = new KanbanBoard(); - $board->name = 'Name'; + $board->name = 'Name'; $board->description = 'Description'; $board->setStatus(BoardStatus::ARCHIVED); $board->createdBy = new NullAccount(1); diff --git a/tests/Models/KanbanCardCommentTest.php b/tests/Models/KanbanCardCommentTest.php index 82dce08..bca8a68 100755 --- a/tests/Models/KanbanCardCommentTest.php +++ b/tests/Models/KanbanCardCommentTest.php @@ -48,7 +48,7 @@ class KanbanCardCommentTest extends \PHPUnit\Framework\TestCase $comment->setCard(2); $comment->description = 'Description'; - $comment->createdBy = new NullAccount(1); + $comment->createdBy = new NullAccount(1); $comment->addMedia(3); self::assertEquals(2, $comment->getCard()); diff --git a/tests/Models/KanbanCardTest.php b/tests/Models/KanbanCardTest.php index 2922e3e..860640d 100755 --- a/tests/Models/KanbanCardTest.php +++ b/tests/Models/KanbanCardTest.php @@ -55,7 +55,7 @@ class KanbanCardTest extends \PHPUnit\Framework\TestCase $card = new KanbanCard(); $card->setStatus(CardStatus::ARCHIVED); $card->setType(CardType::TASK); - $card->name = 'Name'; + $card->name = 'Name'; $card->description = 'Description'; $card->setColumn(1); $card->setOrder(2);