@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | $this->mockObjects['importTwine']->expects($this->once()) |
| 81 | 81 | ->method('run') |
| 82 | - ->will($this->returnCallback(function ($importfile) { |
|
| 82 | + ->will($this->returnCallback(function($importfile) { |
|
| 83 | 83 | return $importfile->getFilename() === 'somefile_readable_exists.html' |
| 84 | 84 | && $importfile->getLicenseeId() === 'licenseeId' |
| 85 | 85 | && $importfile->getAuthor() === 'someauthor' |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | { |
| 152 | 152 | $this->mockObjects['importTwine']->expects($this->once()) |
| 153 | 153 | ->method('run') |
| 154 | - ->will($this->returnCallback(function ($importfile) { |
|
| 154 | + ->will($this->returnCallback(function($importfile) { |
|
| 155 | 155 | return $importfile->getFilename() === 'somefile_readable_exists.html' |
| 156 | 156 | && $importfile->getLicenseeId() === 'licenseeId' |
| 157 | 157 | && $importfile->getAuthor() === 'someauthor' |
@@ -68,12 +68,12 @@ |
||
| 68 | 68 | |
| 69 | 69 | $readpathRepositoryMock->expects($this->once()) |
| 70 | 70 | ->method('save') |
| 71 | - ->willReturnCallback(function (ReadpathDocument $readpathDocument) use ($textnodeMockId, $userMockId) { |
|
| 71 | + ->willReturnCallback(function(ReadpathDocument $readpathDocument) use ($textnodeMockId, $userMockId) { |
|
| 72 | 72 | $this->assertInstanceOf(ReadpathDocument::class, $readpathDocument); |
| 73 | 73 | $this->assertEquals($textnodeMockId, $readpathDocument->getTextnodeId()); |
| 74 | 74 | $this->assertEquals($userMockId, $readpathDocument->getUserId()); |
| 75 | 75 | $this->assertInstanceOf(\MongoDate::class, $readpathDocument->getTimestamp()); |
| 76 | - $this->assertLessThanOrEqual(1, abs($readpathDocument->getTimestamp()->sec-time())); |
|
| 76 | + $this->assertLessThanOrEqual(1, abs($readpathDocument->getTimestamp()->sec - time())); |
|
| 77 | 77 | }); |
| 78 | 78 | |
| 79 | 79 | $readpath = new Readpath($readpathRepositoryMock); |
@@ -265,8 +265,8 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | self::$freadStack = [ |
| 267 | 267 | '<tw-storydata ', |
| 268 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
| 269 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
| 268 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
| 269 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
| 270 | 270 | '<tw-passagedata pid="1" name="someNodeName" tags="Freigegeben ID:foobar" position="104,30">lorem impsum', |
| 271 | 271 | 'lorem impsum</tw-passagedata></tw-storydata>', |
| 272 | 272 | ]; |
@@ -310,8 +310,8 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | self::$freadStack = [ |
| 312 | 312 | '<tw-storydata ', |
| 313 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
| 314 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
| 313 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
| 314 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
| 315 | 315 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben ID:foobar" position="104,30">lorem ipsum', |
| 316 | 316 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
| 317 | 317 | ]; |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | $textnodeRepository->expects($this->once()) |
| 332 | 332 | ->method('save') |
| 333 | - ->with($this->callback(function ($textnode) { |
|
| 333 | + ->with($this->callback(function($textnode) { |
|
| 334 | 334 | return $textnode instanceof Textnode |
| 335 | 335 | && $textnode->getText() === "lorem ipsumlorem ipsum"; |
| 336 | 336 | })); |
@@ -355,8 +355,8 @@ discard block |
||
| 355 | 355 | |
| 356 | 356 | self::$freadStack = [ |
| 357 | 357 | '<tw-storydata ', |
| 358 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
| 359 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
| 358 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
| 359 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
| 360 | 360 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben ID:foobar" position="104,30">lorem ipsum', |
| 361 | 361 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
| 362 | 362 | ]; |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | |
| 377 | 377 | $textnodeRepository->expects($this->any()) |
| 378 | 378 | ->method('save') |
| 379 | - ->with($this->callback(function ($textnode) { |
|
| 379 | + ->with($this->callback(function($textnode) { |
|
| 380 | 380 | return $textnode instanceof Textnode |
| 381 | 381 | && $textnode->getText() === "lorem ipsumlorem ipsum"; |
| 382 | 382 | })); |
@@ -435,8 +435,8 @@ discard block |
||
| 435 | 435 | |
| 436 | 436 | self::$freadStack = [ |
| 437 | 437 | '<tw-storydata ', |
| 438 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
| 439 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
| 438 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
| 439 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
| 440 | 440 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben" position="104,30">lorem ipsum', |
| 441 | 441 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
| 442 | 442 | ]; |
@@ -473,8 +473,8 @@ discard block |
||
| 473 | 473 | |
| 474 | 474 | self::$freadStack = [ |
| 475 | 475 | '<tw-storydata ', |
| 476 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
| 477 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
| 476 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
| 477 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
| 478 | 478 | '<tw-passagedata pid="1" name="someNodeName1" tags="" position="104,30">lorem ipsum', |
| 479 | 479 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
| 480 | 480 | ]; |
@@ -511,8 +511,8 @@ discard block |
||
| 511 | 511 | |
| 512 | 512 | self::$freadStack = [ |
| 513 | 513 | '<tw-storydata ', |
| 514 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
| 515 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
| 514 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
| 515 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
| 516 | 516 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben ID:foobar" position="104,30">lorem ipsum', |
| 517 | 517 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
| 518 | 518 | ]; |
@@ -550,8 +550,8 @@ discard block |
||
| 550 | 550 | |
| 551 | 551 | self::$freadStack = [ |
| 552 | 552 | '<tw-storydata ', |
| 553 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
| 554 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
| 553 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
| 554 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
| 555 | 555 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben ID:foobar" position="104,30">lorem ipsum', |
| 556 | 556 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
| 557 | 557 | ]; |
@@ -591,8 +591,8 @@ discard block |
||
| 591 | 591 | |
| 592 | 592 | self::$freadStack = [ |
| 593 | 593 | '<tw-storydata ', |
| 594 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
| 595 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
| 594 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
| 595 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
| 596 | 596 | '<tw-passagedata pid="1" name="someNodeName1" tags="Freigegeben ID:foobar" position="104,30">lorem ipsum', |
| 597 | 597 | 'lorem ipsum</tw-passagedata></tw-storydata>', |
| 598 | 598 | ]; |
@@ -636,8 +636,8 @@ discard block |
||
| 636 | 636 | |
| 637 | 637 | self::$freadStack = [ |
| 638 | 638 | '<tw-storydata ', |
| 639 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
| 640 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
| 639 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
| 640 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
| 641 | 641 | '<tw-passagedata pid="1" name="someNodeName1" tags="ID:someTwineId" position="104,30">lorem ipsum', |
| 642 | 642 | 'lorem ipsum</tw-passagedata>', |
| 643 | 643 | '<tw-passagedata pid="2" name="someNodeName2" tags="ID:someTwineId" position="104,30">lorem ipsum', |
@@ -677,8 +677,8 @@ discard block |
||
| 677 | 677 | |
| 678 | 678 | self::$freadStack = [ |
| 679 | 679 | '<tw-storydata ', |
| 680 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
| 681 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
| 680 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
| 681 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
| 682 | 682 | '<tw-passagedata pid="1" name="someNodeName1" tags="ID:someTwineId1" position="104,30">lorem ipsum', |
| 683 | 683 | 'lorem ipsum [[Linkdata->someNodeName3]]</tw-passagedata>', |
| 684 | 684 | '</tw-storydata>', |
@@ -717,8 +717,8 @@ discard block |
||
| 717 | 717 | |
| 718 | 718 | self::$freadStack = [ |
| 719 | 719 | '<tw-storydata ', |
| 720 | - '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>'."\n", |
|
| 721 | - '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>'."\n", |
|
| 720 | + '<tw-storydata name="someTopicId-->someStoryName" startnode="1" creator="Twine" creator-version="2.0.8" ifid="8E30D51C-4980-4161-B57F-B11C752E879A" format="Harlowe" options=""><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style>' . "\n", |
|
| 721 | + '<script role="script" id="twine-user-script" type="text/twine-javascript"></script>' . "\n", |
|
| 722 | 722 | '<tw-passagedata pid="1" name="someNodeName1" tags="ID:someTwineId1" position="104,30">lorem ipsum', |
| 723 | 723 | 'lorem ipsum [[Linkdata->someNodeName2]]</tw-passagedata>', |
| 724 | 724 | '<tw-passagedata pid="2" name="someNodeName2" tags="ID:someTwineId2" position="104,30">lorem ipsum', |
@@ -745,9 +745,9 @@ discard block |
||
| 745 | 745 | |
| 746 | 746 | $textnodeRepository->expects($this->any()) |
| 747 | 747 | ->method('save') |
| 748 | - ->willReturnCallback(function ($textnode) { |
|
| 748 | + ->willReturnCallback(function($textnode) { |
|
| 749 | 749 | static $counter = 0; |
| 750 | - $textnode->setId('someTextnode'.$counter++); |
|
| 750 | + $textnode->setId('someTextnode' . $counter++); |
|
| 751 | 751 | }); |
| 752 | 752 | |
| 753 | 753 | $importTwine = new ImportTwine($textnodeRepository, $topicRepository); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | /* @var $response \Symfony\Component\HttpFoundation\Response */ |
| 153 | 153 | $response = $controller->usersAction($request); |
| 154 | 154 | $this->assertInstanceOf(Response::class, $response); |
| 155 | - $this->assertJsonStringEqualsJsonString('[{"id":"id1","gender":null,"email":"email1","roles":"ROLE_ADMIN","licenseeId":"lic1","status":null,"source":null,"reason":null,"created":"'.date('Y-m-d H:i:s', 0).'","updated":"'.date('Y-m-d H:i:s', 0).'"},{"id":"id2","email":"email2","roles":"ROLE_USER","licenseeId":"lic2","status":null,"source":null,"reason":null,"gender":null,"created":"'.date('Y-m-d H:i:s', 0).'","updated":"'.date('Y-m-d H:i:s', 0).'"}]', $response->getContent()); |
|
| 155 | + $this->assertJsonStringEqualsJsonString('[{"id":"id1","gender":null,"email":"email1","roles":"ROLE_ADMIN","licenseeId":"lic1","status":null,"source":null,"reason":null,"created":"' . date('Y-m-d H:i:s', 0) . '","updated":"' . date('Y-m-d H:i:s', 0) . '"},{"id":"id2","email":"email2","roles":"ROLE_USER","licenseeId":"lic2","status":null,"source":null,"reason":null,"gender":null,"created":"' . date('Y-m-d H:i:s', 0) . '","updated":"' . date('Y-m-d H:i:s', 0) . '"}]', $response->getContent()); |
|
| 156 | 156 | $this->assertEquals('200', $response->getStatusCode()); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | $this->repository = $this->getMockBuilder(DocumentRepository::class)->disableOriginalConstructor()->getMock(); |
| 511 | 511 | $this->container->expects($this->once()) |
| 512 | 512 | ->method("get") |
| 513 | - ->with($this->equalTo('app.model_repository_'.$repository)) |
|
| 513 | + ->with($this->equalTo('app.model_repository_' . $repository)) |
|
| 514 | 514 | ->will($this->returnValue($this->repository)); |
| 515 | 515 | } |
| 516 | 516 | } |
@@ -96,8 +96,8 @@ |
||
| 96 | 96 | return new Response(\json_encode($output)); |
| 97 | 97 | } |
| 98 | 98 | $directory = $this->getParameter('topic_image_directory'); |
| 99 | - $filename = md5(uniqid().$file['name']); |
|
| 100 | - move_uploaded_file($file["tmp_name"], $directory.$filename); |
|
| 99 | + $filename = md5(uniqid() . $file['name']); |
|
| 100 | + move_uploaded_file($file["tmp_name"], $directory . $filename); |
|
| 101 | 101 | $output['imageFileName'] = $filename; |
| 102 | 102 | $output['originalImageName'] = $file['name']; |
| 103 | 103 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | //$value = $value === 'aktiv' ? 1 : 0; |
| 87 | 87 | $query->field($field)->equals((int) $value); |
| 88 | 88 | } else { |
| 89 | - $query->field($field)->equals(new \MongoRegex('/.*'.$value.'.*/i')); |
|
| 89 | + $query->field($field)->equals(new \MongoRegex('/.*' . $value . '.*/i')); |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | /* @var $repository \Doctrine\ODM\MongoDB\DocumentRepository */ |
| 152 | 152 | $repository = $mongo->getRepository('DembeloMain:Licensee'); |
| 153 | 153 | |
| 154 | - $licensees = $repository->findBy(array('name' => new \MongoRegex('/'.$searchString.'/')), null, 10); |
|
| 154 | + $licensees = $repository->findBy(array('name' => new \MongoRegex('/' . $searchString . '/')), null, 10); |
|
| 155 | 155 | |
| 156 | 156 | $output = array(); |
| 157 | 157 | /* @var $licensee \DembeloMain\Document\Licensee */ |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | $formtype = $params['formtype']; |
| 210 | 210 | |
| 211 | 211 | /* @var $repository AbstractRepository */ |
| 212 | - $repository = $this->get('app.model_repository_'.$formtype); |
|
| 212 | + $repository = $this->get('app.model_repository_' . $formtype); |
|
| 213 | 213 | |
| 214 | 214 | if (isset($params['id']) && $params['id'] == 'new') { |
| 215 | 215 | $className = $repository->getClassName(); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | } elseif ($param === 'imported' && $value === '') { |
| 236 | 236 | $value = null; |
| 237 | 237 | } |
| 238 | - $method = 'set'.ucfirst($param); |
|
| 238 | + $method = 'set' . ucfirst($param); |
|
| 239 | 239 | if (method_exists($item, $method)) { |
| 240 | 240 | $item->$method($value); |
| 241 | 241 | } |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | /* @var $user \DembeloMain\Document\User */ |
| 285 | 285 | $user = $repository->find($userId); |
| 286 | - $user->setActivationHash(sha1($user->getEmail().$user->getPassword().\time())); |
|
| 286 | + $user->setActivationHash(sha1($user->getEmail() . $user->getPassword() . \time())); |
|
| 287 | 287 | |
| 288 | 288 | $dm->persist($user); |
| 289 | 289 | $dm->flush(); |
@@ -355,9 +355,9 @@ discard block |
||
| 355 | 355 | |
| 356 | 356 | $directory = $this->container->getParameter('twine_directory'); |
| 357 | 357 | |
| 358 | - $filename = md5(uniqid().$file['name']); |
|
| 358 | + $filename = md5(uniqid() . $file['name']); |
|
| 359 | 359 | |
| 360 | - move_uploaded_file($file["tmp_name"], $directory.$filename); |
|
| 360 | + move_uploaded_file($file["tmp_name"], $directory . $filename); |
|
| 361 | 361 | |
| 362 | 362 | $output['filename'] = $filename; |
| 363 | 363 | $output['orgname'] = $file['name']; |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | $obj->access = $textnode->getAccess() ? 'ja' : 'nein'; |
| 392 | 392 | $obj->licensee = $licenseeIndex[$textnode->getLicenseeId()]; |
| 393 | 393 | $obj->importfile = isset($importfileIndex[$textnode->getImportfileId()]) ? $importfileIndex[$textnode->getImportfileId()] : 'unbekannt'; |
| 394 | - $obj->beginning = substr(htmlentities(strip_tags($textnode->getText())), 0, 200)."..."; |
|
| 394 | + $obj->beginning = substr(htmlentities(strip_tags($textnode->getText())), 0, 200) . "..."; |
|
| 395 | 395 | $obj->financenode = $textnode->isFinanceNode() ? 'ja' : 'nein'; |
| 396 | 396 | $obj->twineId = $textnode->getTwineId(); |
| 397 | 397 | $obj->metadata = $this->formatMetadata($textnode->getMetadata()); |
@@ -454,12 +454,12 @@ discard block |
||
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | $directory = $this->container->getParameter('twine_directory'); |
| 457 | - $finalDirectory = $directory.$item->getLicenseeId().'/'; |
|
| 457 | + $finalDirectory = $directory . $item->getLicenseeId() . '/'; |
|
| 458 | 458 | if (!is_dir($finalDirectory)) { |
| 459 | 459 | mkdir($finalDirectory); |
| 460 | 460 | } |
| 461 | - $finalName = $finalDirectory.$item->getId(); |
|
| 462 | - $file = $directory.$filename; |
|
| 461 | + $finalName = $finalDirectory . $item->getId(); |
|
| 462 | + $file = $directory . $filename; |
|
| 463 | 463 | rename($file, $finalName); |
| 464 | 464 | |
| 465 | 465 | $item->setOriginalname($orgname); |
@@ -503,12 +503,12 @@ discard block |
||
| 503 | 503 | return; |
| 504 | 504 | } |
| 505 | 505 | $directory = $this->container->getParameter('topic_image_directory'); |
| 506 | - $finalDirectory = $directory.$item->getId().'/'; |
|
| 506 | + $finalDirectory = $directory . $item->getId() . '/'; |
|
| 507 | 507 | if (!is_dir($finalDirectory)) { |
| 508 | 508 | mkdir($finalDirectory); |
| 509 | 509 | } |
| 510 | - $finalName = $finalDirectory.$orgname; |
|
| 511 | - $file = $directory.$filename; |
|
| 510 | + $finalName = $finalDirectory . $orgname; |
|
| 511 | + $file = $directory . $filename; |
|
| 512 | 512 | rename($file, $finalName); |
| 513 | 513 | $item->setOriginalImageName($orgname); |
| 514 | 514 | $item->setImageFilename($finalName); |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | { |
| 519 | 519 | $string = ''; |
| 520 | 520 | foreach ($metadata as $key => $value) { |
| 521 | - $string .= $key.': '.$value."\n"; |
|
| 521 | + $string .= $key . ': ' . $value . "\n"; |
|
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | return $string; |
@@ -98,13 +98,13 @@ discard block |
||
| 98 | 98 | $this->prepare($input); |
| 99 | 99 | |
| 100 | 100 | if (file_exists($this->twineArchivePath) !== true) { |
| 101 | - $this->output->writeln("<error>Parameter 'twine-archive-file': File '".$this->twineArchivePath."' doesn't exist.</error>"); |
|
| 101 | + $this->output->writeln("<error>Parameter 'twine-archive-file': File '" . $this->twineArchivePath . "' doesn't exist.</error>"); |
|
| 102 | 102 | |
| 103 | 103 | return -1; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | if (is_readable($this->twineArchivePath) !== true) { |
| 107 | - $this->output->writeln("<error>Parameter 'twine-archive-file': File '".$this->twineArchivePath."' isn't readable.</error>"); |
|
| 107 | + $this->output->writeln("<error>Parameter 'twine-archive-file': File '" . $this->twineArchivePath . "' isn't readable.</error>"); |
|
| 108 | 108 | |
| 109 | 109 | return -1; |
| 110 | 110 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | $this->dm->flush(); |
| 125 | 125 | } catch (\Exception $ex) { |
| 126 | - $output->writeln('<error>'.$ex->getMessage().'</error>'); |
|
| 126 | + $output->writeln('<error>' . $ex->getMessage() . '</error>'); |
|
| 127 | 127 | |
| 128 | 128 | $importTwine->parserFree(); |
| 129 | 129 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | $licensee = $repositoryLicensee->findOneByName($input->getOption('licensee-name')); |
| 153 | 153 | if (is_null($licensee)) { |
| 154 | - throw new \Exception("<error>A Licensee named '".$input->getOption('licensee-name')."' doesn't exist.</error>"); |
|
| 154 | + throw new \Exception("<error>A Licensee named '" . $input->getOption('licensee-name') . "' doesn't exist.</error>"); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | $this->author = $input->getOption('metadata-author'); |
@@ -70,6 +70,6 @@ |
||
| 70 | 70 | |
| 71 | 71 | private function buildParameterName(string $featureKey) : string |
| 72 | 72 | { |
| 73 | - return 'features.'.$featureKey; |
|
| 73 | + return 'features.' . $featureKey; |
|
| 74 | 74 | } |
| 75 | 75 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function setFavorite(Textnode $textnode, User $user = null) |
| 55 | 55 | { |
| 56 | 56 | if (is_null($user)) { |
| 57 | - $this->session->set('favorite_'.$textnode->getTopicId(), $textnode->getArbitraryId()); |
|
| 57 | + $this->session->set('favorite_' . $textnode->getTopicId(), $textnode->getArbitraryId()); |
|
| 58 | 58 | |
| 59 | 59 | return; |
| 60 | 60 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | public function getFavorite(Topic $topic, User $user = null) |
| 71 | 71 | { |
| 72 | 72 | if (is_null($user)) { |
| 73 | - return $this->session->get('favorite_'.$topic->getId()); |
|
| 73 | + return $this->session->get('favorite_' . $topic->getId()); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | return $user->getFavorite($topic->getId()); |