Update php codestyle

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-12-28 13:05:54 +01:00
parent 1eabb3ee2a
commit 7cc9cf26ef
13 changed files with 27 additions and 27 deletions

View File

@@ -290,7 +290,7 @@ class DeckProvider implements IProvider {
try { try {
$comment = $this->commentsManager->get((int)$subjectParams['comment']); $comment = $this->commentsManager->get((int)$subjectParams['comment']);
$event->setParsedMessage($comment->getMessage()); $event->setParsedMessage($comment->getMessage());
$params['comment'] =[ $params['comment'] = [
'type' => 'highlight', 'type' => 'highlight',
'id' => $subjectParams['comment'], 'id' => $subjectParams['comment'],
'name' => $comment->getMessage() 'name' => $comment->getMessage()

View File

@@ -389,7 +389,7 @@ trait BasicStructure {
* @BeforeSuite * @BeforeSuite
*/ */
public static function addFilesToSkeleton() { 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"); file_put_contents("../../core/skeleton/" . "textfile" . "$i" . ".txt", "Nextcloud test text file\n");
} }
if (!file_exists("../../core/skeleton/FOLDER")) { if (!file_exists("../../core/skeleton/FOLDER")) {
@@ -409,7 +409,7 @@ trait BasicStructure {
* @AfterSuite * @AfterSuite
*/ */
public static function removeFilesFromSkeleton() { public static function removeFilesFromSkeleton() {
for ($i=0; $i<5; $i++) { for ($i = 0; $i < 5; $i++) {
self::removeFile("../../core/skeleton/", "textfile" . "$i" . ".txt"); self::removeFile("../../core/skeleton/", "textfile" . "$i" . ".txt");
} }
if (is_dir("../../core/skeleton/FOLDER")) { if (is_dir("../../core/skeleton/FOLDER")) {

View File

@@ -50,10 +50,10 @@ class UserExportTest extends \Test\TestCase {
public function setUp(): void { public function setUp(): void {
parent::setUp(); parent::setUp();
$this->boardMapper = $this->createMock(BoardMapper::class); $this->boardMapper = $this->createMock(BoardMapper::class);
$this->boardService= $this->createMock(BoardService::class); $this->boardService = $this->createMock(BoardService::class);
$this->stackMapper= $this->createMock(StackMapper::class); $this->stackMapper = $this->createMock(StackMapper::class);
$this->cardMapper= $this->createMock(CardMapper::class); $this->cardMapper = $this->createMock(CardMapper::class);
$this->assignedUserMapper= $this->createMock(AssignmentMapper::class); $this->assignedUserMapper = $this->createMock(AssignmentMapper::class);
$this->userManager = $this->createMock(IUserManager::class); $this->userManager = $this->createMock(IUserManager::class);
$this->groupManager = $this->createMock(IGroupManager::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); $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(2),
$this->getCard(3), $this->getCard(3),
]; ];
$this->cardMapper->expects($this->exactly(count($boards)*count($stacks))) $this->cardMapper->expects($this->exactly(count($boards) * count($stacks)))
->method('findAllByStack') ->method('findAllByStack')
->willReturn($cards); ->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') ->method('find')
->willReturn($cards[0]); ->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') ->method('find')
->willReturn([]); ->willReturn([]);
$result = $this->invokePrivate($this->userExport, 'execute', [$input, $output]); $result = $this->invokePrivate($this->userExport, 'execute', [$input, $output]);

View File

@@ -74,7 +74,7 @@ class AclMapperTest extends MapperTestUtility {
} }
} }
/** @return Acl */ /** @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 = new Acl();
$acl->setParticipant($participant); $acl->setParticipant($participant);
$acl->setType('user'); $acl->setType('user');

View File

@@ -86,7 +86,7 @@ class BoardMapperTest extends MapperTestUtility {
} }
} }
/** @return Acl */ /** @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 = new Acl();
$acl->setParticipant($participant); $acl->setParticipant($participant);
$acl->setType('user'); $acl->setType('user');

View File

@@ -36,7 +36,7 @@ class RelationalEntityTest extends \Test\TestCase {
$entity = new RelationalEntity(); $entity = new RelationalEntity();
$entity->foo = null; $entity->foo = null;
$entity->setFoo('test'); $entity->setFoo('test');
$this->assertEquals(['foo'=>true], $entity->getUpdatedFields()); $this->assertEquals(['foo' => true], $entity->getUpdatedFields());
} }
public function testJsonSerialize() { public function testJsonSerialize() {

View File

@@ -109,7 +109,7 @@ class UnknownUserTest extends \Test\TestCase {
/** @return Acl */ /** @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 = new Acl();
$acl->setParticipant($participant); $acl->setParticipant($participant);
$acl->setType($type); $acl->setType($type);

View File

@@ -246,7 +246,7 @@ class CardServiceTest extends TestCase {
private function getCards() { private function getCards() {
$cards = []; $cards = [];
for ($i=0; $i<10; $i++) { for ($i = 0; $i < 10; $i++) {
$cards[$i] = new Card(); $cards[$i] = new Card();
$cards[$i]->setTitle($i); $cards[$i]->setTitle($i);
$cards[$i]->setOrder($i); $cards[$i]->setOrder($i);

View File

@@ -216,7 +216,7 @@ class PermissionServiceTest extends \Test\TestCase {
} }
/** @dataProvider dataCheckPermission */ /** @dataProvider dataCheckPermission */
public function testCheckPermission($boardId, $permission, $result, $owner='foo') { public function testCheckPermission($boardId, $permission, $result, $owner = 'foo') {
// Setup mapper // Setup mapper
$mapper = $this->getMockBuilder(IPermissionMapper::class)->getMock(); $mapper = $this->getMockBuilder(IPermissionMapper::class)->getMock();
@@ -245,7 +245,7 @@ class PermissionServiceTest extends \Test\TestCase {
} }
/** @dataProvider dataCheckPermission */ /** @dataProvider dataCheckPermission */
public function testCheckPermissionWithoutMapper($boardId, $permission, $result, $owner='foo') { public function testCheckPermissionWithoutMapper($boardId, $permission, $result, $owner = 'foo') {
$mapper = null; $mapper = null;
$board = new Board(); $board = new Board();
$board->setId($boardId); $board->setId($boardId);

View File

@@ -116,8 +116,8 @@ class StackServiceTest extends TestCase {
$actual = $this->stackService->findAll(123); $actual = $this->stackService->findAll(123);
for ($stackId=0; $stackId<3; $stackId++) { for ($stackId = 0; $stackId < 3; $stackId++) {
for ($cardId=0;$cardId<10;$cardId++) { for ($cardId = 0;$cardId < 10;$cardId++) {
$this->assertEquals($actual[0]->getCards()[$cardId]->getId(), $cardId); $this->assertEquals($actual[0]->getCards()[$cardId]->getId(), $cardId);
$this->assertEquals($actual[0]->getCards()[$cardId]->getStackId(), 222); $this->assertEquals($actual[0]->getCards()[$cardId]->getStackId(), 222);
$this->assertEquals($actual[0]->getCards()[$cardId]->getLabels(), $this->getLabels()[$cardId]); $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)); $this->cardMapper->expects($this->any())->method('findAllArchived')->willReturn($this->getCards(222));
$actual = $this->stackService->findAllArchived(123); $actual = $this->stackService->findAllArchived(123);
for ($stackId=0; $stackId<3; $stackId++) { for ($stackId = 0; $stackId < 3; $stackId++) {
for ($cardId=0;$cardId<10;$cardId++) { for ($cardId = 0;$cardId < 10;$cardId++) {
$this->assertEquals($actual[0]->getCards()[$cardId]->getId(), $cardId); $this->assertEquals($actual[0]->getCards()[$cardId]->getId(), $cardId);
$this->assertEquals($actual[0]->getCards()[$cardId]->getStackId(), 222); $this->assertEquals($actual[0]->getCards()[$cardId]->getStackId(), 222);
$this->assertEquals($actual[0]->getCards()[$cardId]->getLabels(), $this->getLabels()[$cardId]); $this->assertEquals($actual[0]->getCards()[$cardId]->getLabels(), $this->getLabels()[$cardId]);
@@ -142,7 +142,7 @@ class StackServiceTest extends TestCase {
} }
private function getLabels() { private function getLabels() {
for ($i=0;$i<10;$i++) { for ($i = 0;$i < 10;$i++) {
$label1 = new Label(); $label1 = new Label();
$label1->setTitle('Important'); $label1->setTitle('Important');
$label1->setCardId(1); $label1->setCardId(1);
@@ -165,9 +165,9 @@ class StackServiceTest extends TestCase {
$s1->setBoardId(1); $s1->setBoardId(1);
return [$s1, $s2]; return [$s1, $s2];
} }
private function getCards($stackId=0) { private function getCards($stackId = 0) {
$cards = []; $cards = [];
for ($i=0;$i<10;$i++) { for ($i = 0;$i < 10;$i++) {
$cards[$i] = new Card(); $cards[$i] = new Card();
$cards[$i]->setId($i); $cards[$i]->setId($i);
$cards[$i]->setStackId($stackId); $cards[$i]->setStackId($stackId);