Passed
Push — master ( c71cfc...3755d0 )
by Michael
01:44
created
www/src/AdminBundle/Controller/UserController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                     //$value = $value === 'aktiv' ? 1 : 0;
78 78
                     $query->field($field)->equals((int) $value);
79 79
                 } else {
80
-                    $query->field($field)->equals(new \MongoRegex('/.*'.$value.'.*/i'));
80
+                    $query->field($field)->equals(new \MongoRegex('/.*' . $value . '.*/i'));
81 81
                 }
82 82
             }
83 83
         }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         if (null === $user) {
120 120
             return new Response(\json_encode(['error' => false]));
121 121
         }
122
-        $user->setActivationHash(sha1($user->getEmail().$user->getPassword().\time()));
122
+        $user->setActivationHash(sha1($user->getEmail() . $user->getPassword() . \time()));
123 123
 
124 124
         $this->userRepository->save($user);
125 125
 
Please login to merge, or discard this patch.
www/src/AdminBundle/Controller/ImportfileController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $importfile = $this->importfileRepository->find($importfileId);
124 124
         try {
125 125
             if (null === $importfile) {
126
-                throw new \RuntimeException('file with id ['.$importfileId.'] not found');
126
+                throw new \RuntimeException('file with id [' . $importfileId . '] not found');
127 127
             }
128 128
             $returnValue = $this->importTwine->run($importfile);
129 129
 
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
             return new Response(\json_encode($output));
161 161
         }
162 162
 
163
-        $filename = md5(uniqid('', true).$file['name']);
163
+        $filename = md5(uniqid('', true) . $file['name']);
164 164
 
165
-        move_uploaded_file($file['tmp_name'], $this->configTwineDirectory.$filename);
165
+        move_uploaded_file($file['tmp_name'], $this->configTwineDirectory . $filename);
166 166
 
167 167
         $output['filename'] = $filename;
168 168
         $output['orgname'] = $file['name'];
Please login to merge, or discard this patch.
www/src/AdminBundle/Controller/TextnodeController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             $obj->access = $textnode->getAccess() ? 'ja' : 'nein';
89 89
             $obj->licensee = $licenseeIndex[$textnode->getLicenseeId()];
90 90
             $obj->importfile = isset($importfileIndex[$textnode->getImportfileId()]) ? $importfileIndex[$textnode->getImportfileId()] : 'unbekannt';
91
-            $obj->beginning = substr(htmlentities(strip_tags($textnode->getText())), 0, 200)."...";
91
+            $obj->beginning = substr(htmlentities(strip_tags($textnode->getText())), 0, 200) . "...";
92 92
             $obj->financenode = $textnode->isFinanceNode() ? 'ja' : 'nein';
93 93
             $obj->twineId = $textnode->getTwineId();
94 94
             $obj->metadata = $this->formatMetadata($textnode->getMetadata());
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     {
114 114
         $string = '';
115 115
         foreach ($metadata as $key => $value) {
116
-            $string .= $key.': '.$value."\n";
116
+            $string .= $key . ': ' . $value . "\n";
117 117
         }
118 118
 
119 119
         return $string;
Please login to merge, or discard this patch.
www/src/AdminBundle/Controller/LicenseeController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
         $searchString = $filter['value'];
85 85
 
86 86
         /* @var $licensees Licensee[] */
87
-        $licensees = $this->licenseeRepository->findBy(['name' => new \MongoRegex('/'.$searchString.'/')], null, 10);
87
+        $licensees = $this->licenseeRepository->findBy(['name' => new \MongoRegex('/' . $searchString . '/')], null, 10);
88 88
 
89 89
         $output = [];
90 90
         foreach ($licensees as $licensee) {
Please login to merge, or discard this patch.
www/src/AdminBundle/Controller/TopicController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             return new Response(\json_encode([]));
69 69
         }
70 70
 
71
-        $output = [] ;
71
+        $output = [];
72 72
         /* @var $topic \DembeloMain\Document\Topic */
73 73
         foreach ($topics as $topic) {
74 74
             $item = [];
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $searchString = $filter['value'];
98 98
 
99 99
         /* @var $topics \DembeloMain\Document\Topic[] */
100
-        $topics = $this->topicRepository->findBy(array('name' => new \MongoRegex('/'.$searchString.'/')), null, 10);
100
+        $topics = $this->topicRepository->findBy(array('name' => new \MongoRegex('/' . $searchString . '/')), null, 10);
101 101
 
102 102
         $output = [];
103 103
         foreach ($topics as $topic) {
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
             return new Response(\json_encode($output));
128 128
         }
129 129
         $directory = $request->query->get('topic_image_directory');
130
-        $filename = md5(uniqid().$file['name']);
131
-        move_uploaded_file($file["tmp_name"], $directory.$filename);
130
+        $filename = md5(uniqid() . $file['name']);
131
+        move_uploaded_file($file["tmp_name"], $directory . $filename);
132 132
         $output['imageFileName'] = $filename;
133 133
         $output['originalImageName'] = $file['name'];
134 134
 
Please login to merge, or discard this patch.
www/src/AdminBundle/Tests/Controller/TopicControllerTest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -186,8 +186,8 @@
 block discarded – undo
186 186
     }
187 187
 
188 188
     /**
189
-    * @return TopicRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject
190
-    */
189
+     * @return TopicRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject
190
+     */
191 191
     private function createTopicRepositoryMock(): TopicRepositoryInterface
192 192
     {
193 193
         return $this->createMock(TopicRepositoryInterface::class);
Please login to merge, or discard this patch.
www/src/AdminBundle/Tests/Controller/UserControllerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
130 130
         /* @var $response \Symfony\Component\HttpFoundation\Response */
131 131
         $response = $this->controller->usersAction($requestMock);
132 132
         $this->assertInstanceOf(Response::class, $response);
133
-        $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());
133
+        $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());
134 134
         $this->assertEquals('200', $response->getStatusCode());
135 135
     }
136 136
 
Please login to merge, or discard this patch.
www/src/AdminBundle/Tests/Controller/DefaultControllerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -253,7 +253,7 @@
 block discarded – undo
253 253
         $this->userPasswordEncoderMock->expects(self::never())
254 254
             ->method('encodePassword');
255 255
 
256
-        $targetFileName = $this->topicImageDirectory.'someId/someOriginalImageFileName';
256
+        $targetFileName = $this->topicImageDirectory . 'someId/someOriginalImageFileName';
257 257
         $this->filesystemMock->expects(self::once())
258 258
             ->method('rename')
259 259
             ->with(self::anything(), $targetFileName);
Please login to merge, or discard this patch.
www/src/AdminBundle/Controller/DefaultController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             } elseif ($value === '' && in_array($param, ['licenseeId', 'imported'], true)) {
213 213
                 $value = null;
214 214
             }
215
-            $method = 'set'.ucfirst($param);
215
+            $method = 'set' . ucfirst($param);
216 216
             if (method_exists($item, $method)) {
217 217
                 $item->$method($value);
218 218
             }
@@ -266,13 +266,13 @@  discard block
 block discarded – undo
266 266
     private function saveFile(Importfile $item, $filename, $orgname)
267 267
     {
268 268
         $directory = $this->configTwineDirectory;
269
-        $file = $directory.$filename;
269
+        $file = $directory . $filename;
270 270
         if (!$this->filesystem->exists($file)) {
271 271
             return;
272 272
         }
273
-        $finalDirectory = $directory.$item->getLicenseeId().'/';
273
+        $finalDirectory = $directory . $item->getLicenseeId() . '/';
274 274
         $this->filesystem->mkdir($finalDirectory);
275
-        $finalName = $finalDirectory.$item->getId();
275
+        $finalName = $finalDirectory . $item->getId();
276 276
 
277 277
         $this->filesystem->rename($file, $finalName);
278 278
 
@@ -291,11 +291,11 @@  discard block
 block discarded – undo
291 291
     private function saveTopicImage(Topic $item, string $filename, string $orgname)
292 292
     {
293 293
         $directory = $this->topicImageDirectory;
294
-        $finalDirectory = $directory.$item->getId().'/';
294
+        $finalDirectory = $directory . $item->getId() . '/';
295 295
         $this->filesystem->mkdir($finalDirectory);
296 296
 
297
-        $finalName = $finalDirectory.$orgname;
298
-        $file = $directory.$filename;
297
+        $finalName = $finalDirectory . $orgname;
298
+        $file = $directory . $filename;
299 299
         $this->filesystem->rename($file, $finalName);
300 300
         $item->setOriginalImageName($orgname);
301 301
         $item->setImageFilename($finalName);
Please login to merge, or discard this patch.