@@ -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 | |
@@ -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 | |
@@ -54,8 +54,8 @@ |
||
| 54 | 54 | $properties = array('id', 'email', 'licenseeId', 'currentTextnode', 'gender', 'source', 'reason', 'password', 'status', 'activationHash'); |
| 55 | 55 | |
| 56 | 56 | foreach ($properties as $property) { |
| 57 | - $getter = 'get'.ucfirst($property); |
|
| 58 | - $setter = 'set'.ucfirst($property); |
|
| 57 | + $getter = 'get' . ucfirst($property); |
|
| 58 | + $setter = 'set' . ucfirst($property); |
|
| 59 | 59 | $string = @tempnam($property, 'hrz'); |
| 60 | 60 | $this->assertNull($this->user->$getter()); |
| 61 | 61 | $this->user->$setter($string); |
@@ -257,14 +257,14 @@ discard block |
||
| 257 | 257 | array('name' => 'Themenfeld 9', 'status' => Topic::STATUS_ACTIVE), |
| 258 | 258 | ); |
| 259 | 259 | |
| 260 | - $imagesSrcFolder = $this->getContainer()->getParameter('kernel.root_dir').'/../src/DembeloMain/Resources/public/images/'; |
|
| 260 | + $imagesSrcFolder = $this->getContainer()->getParameter('kernel.root_dir') . '/../src/DembeloMain/Resources/public/images/'; |
|
| 261 | 261 | $imagesTargetFolder = $this->getContainer()->getParameter('topic_image_directory'); |
| 262 | 262 | |
| 263 | 263 | $sortKey = 1; |
| 264 | 264 | foreach ($topicData as $topicDatum) { |
| 265 | 265 | $topic = $repository->findOneByName($topicDatum['name']); |
| 266 | 266 | if (is_null($topic)) { |
| 267 | - $imagename = 'bg0'.$sortKey.'.jpg'; |
|
| 267 | + $imagename = 'bg0' . $sortKey . '.jpg'; |
|
| 268 | 268 | $topic = new Topic(); |
| 269 | 269 | $topic->setName($topicDatum['name']); |
| 270 | 270 | $topic->setStatus($topicDatum['status']); |
@@ -272,9 +272,9 @@ discard block |
||
| 272 | 272 | $topic->setOriginalImageName($imagename); |
| 273 | 273 | $topic->setImageFilename($imagename); |
| 274 | 274 | $dm->persist($topic); |
| 275 | - $topicFolder = $imagesTargetFolder.'/'.$topic->getId().'/'; |
|
| 275 | + $topicFolder = $imagesTargetFolder . '/' . $topic->getId() . '/'; |
|
| 276 | 276 | mkdir($topicFolder); |
| 277 | - copy($imagesSrcFolder.$imagename, $topicFolder.'/'.$imagename); |
|
| 277 | + copy($imagesSrcFolder . $imagename, $topicFolder . '/' . $imagename); |
|
| 278 | 278 | $sortKey++; |
| 279 | 279 | } |
| 280 | 280 | $this->dummyData['topics'][] = $topic; |
@@ -409,9 +409,9 @@ discard block |
||
| 409 | 409 | |
| 410 | 410 | private function cleanImageDirectories() |
| 411 | 411 | { |
| 412 | - $topicImageDirectory = $this->getContainer()->getParameter('topic_image_directory').'/'; |
|
| 412 | + $topicImageDirectory = $this->getContainer()->getParameter('topic_image_directory') . '/'; |
|
| 413 | 413 | if (is_dir($topicImageDirectory)) { |
| 414 | - shell_exec('rm -r '.$topicImageDirectory.'*'); |
|
| 414 | + shell_exec('rm -r ' . $topicImageDirectory . '*'); |
|
| 415 | 415 | } |
| 416 | 416 | } |
| 417 | 417 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | */ |
| 62 | 62 | public function version() |
| 63 | 63 | { |
| 64 | - $file = $this->container->get('kernel')->getRootDir().'/../../files/version'; |
|
| 64 | + $file = $this->container->get('kernel')->getRootDir() . '/../../files/version'; |
|
| 65 | 65 | |
| 66 | 66 | return file_get_contents($file); |
| 67 | 67 | } |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | |
| 73 | 73 | // the output of the command in the console |
| 74 | 74 | $output = $this->commandTester->getDisplay(); |
| 75 | - $this->assertEquals('admin user installed'."\n".'Default users installed'."\n", $output); |
|
| 75 | + $this->assertEquals('admin user installed' . "\n" . 'Default users installed' . "\n", $output); |
|
| 76 | 76 | $this->assertEquals(0, $returnValue); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | $contentArray = explode("-->", $content, 2); |
| 52 | 52 | |
| 53 | 53 | if (strlen($contentArray[0]) <= 0 || strlen($contentArray[1]) <= 0) { |
| 54 | - throw new Exception("The Twine archive file contains a '".$name."' with the invalid element '[[".$contentArray[0]."-->".$contentArray[1]."]]'."); |
|
| 54 | + throw new Exception("The Twine archive file contains a '" . $name . "' with the invalid element '[[" . $contentArray[0] . "-->" . $contentArray[1] . "]]'."); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $externalTextnode = $this->textnodeRepository->find($contentArray[1]); |
| 58 | 58 | |
| 59 | 59 | if (null === $externalTextnode) { |
| 60 | - throw new Exception("There is a textnode named '".$twineName."' which references the external Dembelo Textnode '".$contentArray[1]."', but a Dembelo Textnode with such an Id doesn't exist."); |
|
| 60 | + throw new Exception("There is a textnode named '" . $twineName . "' which references the external Dembelo Textnode '" . $contentArray[1] . "', but a Dembelo Textnode with such an Id doesn't exist."); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $hitch = array(); |
@@ -73,11 +73,11 @@ discard block |
||
| 73 | 73 | $contentArray = explode("->", $content, 2); |
| 74 | 74 | |
| 75 | 75 | if (strlen($contentArray[0]) <= 0 || strlen($contentArray[1]) <= 0) { |
| 76 | - throw new Exception("The Twine archive file contains a '".$name."' with the invalid element '[[".$contentArray[0]."->".$contentArray[1]."]]'."); |
|
| 76 | + throw new Exception("The Twine archive file contains a '" . $name . "' with the invalid element '[[" . $contentArray[0] . "->" . $contentArray[1] . "]]'."); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | if (array_key_exists($contentArray[1], $this->nodeNameMapping) !== true) { |
| 80 | - throw new Exception("There is a textnode which references another textnode named '".$contentArray[1]."', but this textnode doesn't exist within the same story."); |
|
| 80 | + throw new Exception("There is a textnode which references another textnode named '" . $contentArray[1] . "', but this textnode doesn't exist within the same story."); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | $hitch = array(); |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | $contentArray = explode("<-", $content, 2); |
| 94 | 94 | |
| 95 | 95 | if (strlen($contentArray[0]) <= 0 || strlen($contentArray[1]) <= 0) { |
| 96 | - throw new Exception("The Twine archive file contains a '".$name."' with the invalid element '[[".$contentArray[0]."<-".$contentArray[1]."]]'."); |
|
| 96 | + throw new Exception("The Twine archive file contains a '" . $name . "' with the invalid element '[[" . $contentArray[0] . "<-" . $contentArray[1] . "]]'."); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | if (array_key_exists($contentArray[0], $this->nodeNameMapping) !== true) { |
| 100 | - throw new Exception("There is a textnode in the Twine archive file which references another textnode named '".$contentArray[0]."', but this textnode doesn't exist within the same story."); |
|
| 100 | + throw new Exception("There is a textnode in the Twine archive file which references another textnode named '" . $contentArray[0] . "', but this textnode doesn't exist within the same story."); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $hitch = array(); |
@@ -111,11 +111,11 @@ discard block |
||
| 111 | 111 | public function parseSimpleHitch(string $content, string $name): array |
| 112 | 112 | { |
| 113 | 113 | if (strlen($content) <= 0) { |
| 114 | - throw new Exception("The Twine archive file contains a '".$name."' with the invalid element '[[".$content."]]'."); |
|
| 114 | + throw new Exception("The Twine archive file contains a '" . $name . "' with the invalid element '[[" . $content . "]]'."); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | if (array_key_exists($content, $this->nodeNameMapping) !== true) { |
| 118 | - throw new Exception("There is a textnode in the Twine archive file which references another textnode named '".$content."', but this textnode doesn't exist within the same story."); |
|
| 118 | + throw new Exception("There is a textnode in the Twine archive file which references another textnode named '" . $content . "', but this textnode doesn't exist within the same story."); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | $hitch = array(); |
@@ -156,7 +156,7 @@ |
||
| 156 | 156 | */ |
| 157 | 157 | private function createArbitraryId(Textnode $object): string |
| 158 | 158 | { |
| 159 | - $id = substr(md5(time().$object->getTwineId().substr($object->getText(), 0, 100)), 0, 15); |
|
| 159 | + $id = substr(md5(time() . $object->getTwineId() . substr($object->getText(), 0, 100)), 0, 15); |
|
| 160 | 160 | $exists = count($this->findBy(array('arbitraryId' => $id))) > 0; |
| 161 | 161 | |
| 162 | 162 | if ($exists) { |