@@ -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()); |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | //$value = $value === 'aktiv' ? 1 : 0; |
| 58 | 58 | $query->field($field)->equals((int) $value); |
| 59 | 59 | } else { |
| 60 | - $query->field($field)->equals(new \MongoRegex('/.*'.$value.'.*/i')); |
|
| 60 | + $query->field($field)->equals(new \MongoRegex('/.*' . $value . '.*/i')); |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | */ |
| 155 | 155 | private function createArbitraryId($object) |
| 156 | 156 | { |
| 157 | - $id = substr(md5(time().$object->getTwineId().substr($object->getText(), 0, 100)), 0, 15); |
|
| 157 | + $id = substr(md5(time() . $object->getTwineId() . substr($object->getText(), 0, 100)), 0, 15); |
|
| 158 | 158 | $exists = count($this->findBy(array('arbitraryId' => $id))) > 0; |
| 159 | 159 | |
| 160 | 160 | if ($exists) { |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $router->expects($this->once()) |
| 131 | 131 | ->method("generate") |
| 132 | 132 | ->with("login_route", array()) |
| 133 | - ->will($this->returnValue("text/".$textnode->getId())); |
|
| 133 | + ->will($this->returnValue("text/" . $textnode->getId())); |
|
| 134 | 134 | |
| 135 | 135 | $controller = new DefaultController(); |
| 136 | 136 | $controller->setContainer($container); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $this->assertEquals('Symfony\Component\HttpFoundation\RedirectResponse', get_class($result)); |
| 141 | 141 | $this->assertEquals('302', $result->getStatusCode()); |
| 142 | - $this->assertEquals('text/'.$textnode->getId(), $result->getTargetUrl()); |
|
| 142 | + $this->assertEquals('text/' . $textnode->getId(), $result->getTargetUrl()); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** @todo Implement testReadTopicWithLogin(). */ |