diff --git a/lib/Activity/DeckProvider.php b/lib/Activity/DeckProvider.php index c461b0321..735565378 100644 --- a/lib/Activity/DeckProvider.php +++ b/lib/Activity/DeckProvider.php @@ -290,7 +290,7 @@ class DeckProvider implements IProvider { try { $comment = $this->commentsManager->get((int)$subjectParams['comment']); $event->setParsedMessage($comment->getMessage()); - $params['comment'] =[ + $params['comment'] = [ 'type' => 'highlight', 'id' => $subjectParams['comment'], 'name' => $comment->getMessage() diff --git a/lib/Cron/CardDescriptionActivity.php b/lib/Cron/CardDescriptionActivity.php index 755ec96da..bf3cee9e8 100644 --- a/lib/Cron/CardDescriptionActivity.php +++ b/lib/Cron/CardDescriptionActivity.php @@ -36,7 +36,7 @@ class CardDescriptionActivity extends Job { private $cardMapper; public function __construct(ActivityManager $activityManager, CardMapper $cardMapper) { - $this->activityManager = $activityManager; + $this->activityManager = $activityManager; $this->cardMapper = $cardMapper; } diff --git a/lib/DAV/Calendar.php b/lib/DAV/Calendar.php index 30d6b4024..6e73999a4 100644 --- a/lib/DAV/Calendar.php +++ b/lib/DAV/Calendar.php @@ -204,7 +204,7 @@ class Calendar extends ExternalCalendar { public function getProperties($properties) { return [ '{DAV:}displayname' => 'Deck: ' . ($this->board ? $this->board->getTitle() : 'no board object provided'), - '{http://apple.com/ns/ical/}calendar-color' => '#' . $this->board->getColor(), + '{http://apple.com/ns/ical/}calendar-color' => '#' . $this->board->getColor(), '{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO']), ]; } diff --git a/lib/Db/ChangeHelper.php b/lib/Db/ChangeHelper.php index 598f779f9..2e884fdb8 100644 --- a/lib/Db/ChangeHelper.php +++ b/lib/Db/ChangeHelper.php @@ -49,7 +49,7 @@ class ChangeHelper { $time = time(); $etag = md5($time . microtime()); $this->cache->set(self::TYPE_BOARD . '-' . $boardId, $etag); - $sql = 'UPDATE `*PREFIX*deck_boards` SET `last_modified` = ? WHERE `id` = ?'; + $sql = 'UPDATE `*PREFIX*deck_boards` SET `last_modified` = ? WHERE `id` = ?'; $this->db->executeUpdate($sql, [$time, $boardId]); } diff --git a/tests/integration/features/bootstrap/BasicStructure.php b/tests/integration/features/bootstrap/BasicStructure.php index 2e59cc6f3..58b54efa8 100644 --- a/tests/integration/features/bootstrap/BasicStructure.php +++ b/tests/integration/features/bootstrap/BasicStructure.php @@ -389,7 +389,7 @@ trait BasicStructure { * @BeforeSuite */ public static function addFilesToSkeleton() { - for ($i=0; $i<5; $i++) { + for ($i = 0; $i < 5; $i++) { file_put_contents("../../core/skeleton/" . "textfile" . "$i" . ".txt", "Nextcloud test text file\n"); } if (!file_exists("../../core/skeleton/FOLDER")) { @@ -409,7 +409,7 @@ trait BasicStructure { * @AfterSuite */ public static function removeFilesFromSkeleton() { - for ($i=0; $i<5; $i++) { + for ($i = 0; $i < 5; $i++) { self::removeFile("../../core/skeleton/", "textfile" . "$i" . ".txt"); } if (is_dir("../../core/skeleton/FOLDER")) { diff --git a/tests/unit/Command/UserExportTest.php b/tests/unit/Command/UserExportTest.php index e8eb39527..b232399f0 100644 --- a/tests/unit/Command/UserExportTest.php +++ b/tests/unit/Command/UserExportTest.php @@ -50,10 +50,10 @@ class UserExportTest extends \Test\TestCase { public function setUp(): void { parent::setUp(); $this->boardMapper = $this->createMock(BoardMapper::class); - $this->boardService= $this->createMock(BoardService::class); - $this->stackMapper= $this->createMock(StackMapper::class); - $this->cardMapper= $this->createMock(CardMapper::class); - $this->assignedUserMapper= $this->createMock(AssignmentMapper::class); + $this->boardService = $this->createMock(BoardService::class); + $this->stackMapper = $this->createMock(StackMapper::class); + $this->cardMapper = $this->createMock(CardMapper::class); + $this->assignedUserMapper = $this->createMock(AssignmentMapper::class); $this->userManager = $this->createMock(IUserManager::class); $this->groupManager = $this->createMock(IGroupManager::class); $this->userExport = new UserExport($this->boardMapper, $this->boardService, $this->stackMapper, $this->cardMapper, $this->assignedUserMapper, $this->userManager, $this->groupManager); @@ -104,13 +104,13 @@ class UserExportTest extends \Test\TestCase { $this->getCard(2), $this->getCard(3), ]; - $this->cardMapper->expects($this->exactly(count($boards)*count($stacks))) + $this->cardMapper->expects($this->exactly(count($boards) * count($stacks))) ->method('findAllByStack') ->willReturn($cards); - $this->cardMapper->expects($this->exactly(count($boards)*count($stacks)*count($cards))) + $this->cardMapper->expects($this->exactly(count($boards) * count($stacks) * count($cards))) ->method('find') ->willReturn($cards[0]); - $this->assignedUserMapper->expects($this->exactly(count($boards)*count($stacks)*count($cards))) + $this->assignedUserMapper->expects($this->exactly(count($boards) * count($stacks) * count($cards))) ->method('find') ->willReturn([]); $result = $this->invokePrivate($this->userExport, 'execute', [$input, $output]); diff --git a/tests/unit/Db/AclMapperTest.php b/tests/unit/Db/AclMapperTest.php index 095c3815a..97d57ef54 100644 --- a/tests/unit/Db/AclMapperTest.php +++ b/tests/unit/Db/AclMapperTest.php @@ -74,7 +74,7 @@ class AclMapperTest extends MapperTestUtility { } } /** @return Acl */ - public function getAcl($type='user', $participant='admin', $edit=false, $share=false, $manage=false, $boardId=123) { + public function getAcl($type = 'user', $participant = 'admin', $edit = false, $share = false, $manage = false, $boardId = 123) { $acl = new Acl(); $acl->setParticipant($participant); $acl->setType('user'); diff --git a/tests/unit/Db/BoardMapperTest.php b/tests/unit/Db/BoardMapperTest.php index 82a83e29e..b34f92b93 100644 --- a/tests/unit/Db/BoardMapperTest.php +++ b/tests/unit/Db/BoardMapperTest.php @@ -86,7 +86,7 @@ class BoardMapperTest extends MapperTestUtility { } } /** @return Acl */ - public function getAcl($type='user', $participant='admin', $edit=false, $share=false, $manage=false, $boardId=123) { + public function getAcl($type = 'user', $participant = 'admin', $edit = false, $share = false, $manage = false, $boardId = 123) { $acl = new Acl(); $acl->setParticipant($participant); $acl->setType('user'); diff --git a/tests/unit/Db/RelationalEntityTest.php b/tests/unit/Db/RelationalEntityTest.php index f2791c8eb..d9b4360b5 100644 --- a/tests/unit/Db/RelationalEntityTest.php +++ b/tests/unit/Db/RelationalEntityTest.php @@ -36,7 +36,7 @@ class RelationalEntityTest extends \Test\TestCase { $entity = new RelationalEntity(); $entity->foo = null; $entity->setFoo('test'); - $this->assertEquals(['foo'=>true], $entity->getUpdatedFields()); + $this->assertEquals(['foo' => true], $entity->getUpdatedFields()); } public function testJsonSerialize() { diff --git a/tests/unit/Migration/UnknownUserTest.php b/tests/unit/Migration/UnknownUserTest.php index 932e00fd6..75796bdd8 100644 --- a/tests/unit/Migration/UnknownUserTest.php +++ b/tests/unit/Migration/UnknownUserTest.php @@ -109,7 +109,7 @@ class UnknownUserTest extends \Test\TestCase { /** @return Acl */ - public function getAcl($type=Acl::PERMISSION_TYPE_USER, $participant='admin', $boardId=123) { + public function getAcl($type = Acl::PERMISSION_TYPE_USER, $participant = 'admin', $boardId = 123) { $acl = new Acl(); $acl->setParticipant($participant); $acl->setType($type); diff --git a/tests/unit/Service/CardServiceTest.php b/tests/unit/Service/CardServiceTest.php index 1d9b17c21..cdcabcb4a 100644 --- a/tests/unit/Service/CardServiceTest.php +++ b/tests/unit/Service/CardServiceTest.php @@ -246,7 +246,7 @@ class CardServiceTest extends TestCase { private function getCards() { $cards = []; - for ($i=0; $i<10; $i++) { + for ($i = 0; $i < 10; $i++) { $cards[$i] = new Card(); $cards[$i]->setTitle($i); $cards[$i]->setOrder($i); diff --git a/tests/unit/Service/PermissionServiceTest.php b/tests/unit/Service/PermissionServiceTest.php index 737237e9f..8d403f63b 100644 --- a/tests/unit/Service/PermissionServiceTest.php +++ b/tests/unit/Service/PermissionServiceTest.php @@ -216,7 +216,7 @@ class PermissionServiceTest extends \Test\TestCase { } /** @dataProvider dataCheckPermission */ - public function testCheckPermission($boardId, $permission, $result, $owner='foo') { + public function testCheckPermission($boardId, $permission, $result, $owner = 'foo') { // Setup mapper $mapper = $this->getMockBuilder(IPermissionMapper::class)->getMock(); @@ -245,7 +245,7 @@ class PermissionServiceTest extends \Test\TestCase { } /** @dataProvider dataCheckPermission */ - public function testCheckPermissionWithoutMapper($boardId, $permission, $result, $owner='foo') { + public function testCheckPermissionWithoutMapper($boardId, $permission, $result, $owner = 'foo') { $mapper = null; $board = new Board(); $board->setId($boardId); diff --git a/tests/unit/Service/StackServiceTest.php b/tests/unit/Service/StackServiceTest.php index 2c4d9686f..e40d8e93c 100644 --- a/tests/unit/Service/StackServiceTest.php +++ b/tests/unit/Service/StackServiceTest.php @@ -116,8 +116,8 @@ class StackServiceTest extends TestCase { $actual = $this->stackService->findAll(123); - for ($stackId=0; $stackId<3; $stackId++) { - for ($cardId=0;$cardId<10;$cardId++) { + for ($stackId = 0; $stackId < 3; $stackId++) { + for ($cardId = 0;$cardId < 10;$cardId++) { $this->assertEquals($actual[0]->getCards()[$cardId]->getId(), $cardId); $this->assertEquals($actual[0]->getCards()[$cardId]->getStackId(), 222); $this->assertEquals($actual[0]->getCards()[$cardId]->getLabels(), $this->getLabels()[$cardId]); @@ -132,8 +132,8 @@ class StackServiceTest extends TestCase { $this->cardMapper->expects($this->any())->method('findAllArchived')->willReturn($this->getCards(222)); $actual = $this->stackService->findAllArchived(123); - for ($stackId=0; $stackId<3; $stackId++) { - for ($cardId=0;$cardId<10;$cardId++) { + for ($stackId = 0; $stackId < 3; $stackId++) { + for ($cardId = 0;$cardId < 10;$cardId++) { $this->assertEquals($actual[0]->getCards()[$cardId]->getId(), $cardId); $this->assertEquals($actual[0]->getCards()[$cardId]->getStackId(), 222); $this->assertEquals($actual[0]->getCards()[$cardId]->getLabels(), $this->getLabels()[$cardId]); @@ -142,7 +142,7 @@ class StackServiceTest extends TestCase { } private function getLabels() { - for ($i=0;$i<10;$i++) { + for ($i = 0;$i < 10;$i++) { $label1 = new Label(); $label1->setTitle('Important'); $label1->setCardId(1); @@ -165,9 +165,9 @@ class StackServiceTest extends TestCase { $s1->setBoardId(1); return [$s1, $s2]; } - private function getCards($stackId=0) { + private function getCards($stackId = 0) { $cards = []; - for ($i=0;$i<10;$i++) { + for ($i = 0;$i < 10;$i++) { $cards[$i] = new Card(); $cards[$i]->setId($i); $cards[$i]->setStackId($stackId);