@@ -78,6 +78,6 @@ |
||
78 | 78 | */ |
79 | 79 | private function buildParameterName(string $featureKey): string |
80 | 80 | { |
81 | - return 'features.'.$featureKey; |
|
81 | + return 'features.' . $featureKey; |
|
82 | 82 | } |
83 | 83 | } |
@@ -289,9 +289,9 @@ |
||
289 | 289 | $hitch['status'] = Textnode::HITCH_STATUS_ACTIVE; |
290 | 290 | |
291 | 291 | if ($i < Textnode::HITCHES_MAXIMUM_COUNT) { |
292 | - $this->assertTrue($this->textnode->appendHitch($hitch), 'adding hitch no. '.$i); |
|
292 | + $this->assertTrue($this->textnode->appendHitch($hitch), 'adding hitch no. ' . $i); |
|
293 | 293 | } else { |
294 | - $this->assertFalse($this->textnode->appendHitch($hitch), 'adding hitch no. '.$i); |
|
294 | + $this->assertFalse($this->textnode->appendHitch($hitch), 'adding hitch no. ' . $i); |
|
295 | 295 | } |
296 | 296 | } |
297 | 297 | } |
@@ -295,14 +295,14 @@ discard block |
||
295 | 295 | array('name' => 'Themenfeld 9', 'status' => Topic::STATUS_ACTIVE), |
296 | 296 | ); |
297 | 297 | |
298 | - $imagesSrcFolder = $this->getContainer()->getParameter('kernel.root_dir').'/../src/DembeloMain/Resources/public/images/'; |
|
298 | + $imagesSrcFolder = $this->getContainer()->getParameter('kernel.root_dir') . '/../src/DembeloMain/Resources/public/images/'; |
|
299 | 299 | $imagesTargetFolder = $this->getContainer()->getParameter('topic_image_directory'); |
300 | 300 | |
301 | 301 | $sortKey = 1; |
302 | 302 | foreach ($topicData as $topicDatum) { |
303 | 303 | $topic = $repository->findOneByName($topicDatum['name']); |
304 | 304 | if (is_null($topic)) { |
305 | - $imagename = 'bg0'.$sortKey.'.jpg'; |
|
305 | + $imagename = 'bg0' . $sortKey . '.jpg'; |
|
306 | 306 | $topic = new Topic(); |
307 | 307 | $topic->setName($topicDatum['name']); |
308 | 308 | $topic->setStatus($topicDatum['status']); |
@@ -310,9 +310,9 @@ discard block |
||
310 | 310 | $topic->setOriginalImageName($imagename); |
311 | 311 | $topic->setImageFilename($imagename); |
312 | 312 | $dm->persist($topic); |
313 | - $topicFolder = $imagesTargetFolder.'/'.$topic->getId().'/'; |
|
313 | + $topicFolder = $imagesTargetFolder . '/' . $topic->getId() . '/'; |
|
314 | 314 | mkdir($topicFolder); |
315 | - copy($imagesSrcFolder.$imagename, $topicFolder.'/'.$imagename); |
|
315 | + copy($imagesSrcFolder . $imagename, $topicFolder . '/' . $imagename); |
|
316 | 316 | ++$sortKey; |
317 | 317 | } |
318 | 318 | $this->dummyData['topics'][] = $topic; |
@@ -458,9 +458,9 @@ discard block |
||
458 | 458 | */ |
459 | 459 | private function cleanImageDirectories() |
460 | 460 | { |
461 | - $topicImageDirectory = $this->getContainer()->getParameter('topic_image_directory').'/'; |
|
461 | + $topicImageDirectory = $this->getContainer()->getParameter('topic_image_directory') . '/'; |
|
462 | 462 | if (is_dir($topicImageDirectory)) { |
463 | - shell_exec('rm -r '.$topicImageDirectory.'*'); |
|
463 | + shell_exec('rm -r ' . $topicImageDirectory . '*'); |
|
464 | 464 | } |
465 | 465 | } |
466 | 466 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | if (!is_readable($filename)) { |
35 | 35 | throw new \InvalidArgumentException(sprintf('Failed to read data from file [%s].', $filename)); |
36 | 36 | } |
37 | - $extractedFilename = $filename.'.extracted'; |
|
37 | + $extractedFilename = $filename . '.extracted'; |
|
38 | 38 | $fileHandle = fopen($filename, 'r'); |
39 | 39 | $extractedFileHandle = fopen($extractedFilename, 'w'); |
40 | 40 | $writing = false; |
@@ -230,7 +230,7 @@ |
||
230 | 230 | * |
231 | 231 | * @throws \Exception |
232 | 232 | */ |
233 | - private function appendHitchToTextnode(Textnode $textnode, ?array $hitch): void |
|
233 | + private function appendHitchToTextnode(Textnode $textnode, ? array $hitch) : void |
|
234 | 234 | { |
235 | 235 | if (null === $hitch) { |
236 | 236 | return; |
@@ -157,9 +157,9 @@ |
||
157 | 157 | return new Response(\json_encode($output)); |
158 | 158 | } |
159 | 159 | |
160 | - $filename = md5(uniqid('', true).$file['name']); |
|
160 | + $filename = md5(uniqid('', true) . $file['name']); |
|
161 | 161 | |
162 | - move_uploaded_file($file['tmp_name'], $this->configTwineDirectory.$filename); |
|
162 | + move_uploaded_file($file['tmp_name'], $this->configTwineDirectory . $filename); |
|
163 | 163 | |
164 | 164 | $output['filename'] = $filename; |
165 | 165 | $output['orgname'] = $file['name']; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | } elseif ('' === $value && in_array($param, ['licenseeId', 'imported'], true)) { |
209 | 209 | $value = null; |
210 | 210 | } |
211 | - $method = 'set'.ucfirst($param); |
|
211 | + $method = 'set' . ucfirst($param); |
|
212 | 212 | if (method_exists($item, $method)) { |
213 | 213 | $item->$method($value); |
214 | 214 | } |
@@ -261,13 +261,13 @@ discard block |
||
261 | 261 | private function saveFile(Importfile $item, $filename, $orgname) |
262 | 262 | { |
263 | 263 | $directory = $this->configTwineDirectory; |
264 | - $file = $directory.$filename; |
|
264 | + $file = $directory . $filename; |
|
265 | 265 | if (!$this->filesystem->exists($file)) { |
266 | 266 | return; |
267 | 267 | } |
268 | - $finalDirectory = $directory.$item->getLicenseeId().'/'; |
|
268 | + $finalDirectory = $directory . $item->getLicenseeId() . '/'; |
|
269 | 269 | $this->filesystem->mkdir($finalDirectory); |
270 | - $finalName = $finalDirectory.$item->getId(); |
|
270 | + $finalName = $finalDirectory . $item->getId(); |
|
271 | 271 | |
272 | 272 | $this->filesystem->rename($file, $finalName); |
273 | 273 | |
@@ -287,11 +287,11 @@ discard block |
||
287 | 287 | private function saveTopicImage(Topic $item, string $filename, string $orgname) |
288 | 288 | { |
289 | 289 | $directory = $this->topicImageDirectory; |
290 | - $finalDirectory = $directory.$item->getId().'/'; |
|
290 | + $finalDirectory = $directory . $item->getId() . '/'; |
|
291 | 291 | $this->filesystem->mkdir($finalDirectory); |
292 | 292 | |
293 | - $finalName = $finalDirectory.$orgname; |
|
294 | - $file = $directory.$filename; |
|
293 | + $finalName = $finalDirectory . $orgname; |
|
294 | + $file = $directory . $filename; |
|
295 | 295 | $this->filesystem->rename($file, $finalName); |
296 | 296 | $item->setOriginalImageName($orgname); |
297 | 297 | $item->setImageFilename($finalName); |
@@ -248,7 +248,7 @@ |
||
248 | 248 | private function characterData($parser, string $data): void |
249 | 249 | { |
250 | 250 | if ($this->parserContext->isTwineRelevant() && $this->parserContext->isTwineText()) { |
251 | - $this->parserContext->getCurrentTextnode()->setText($this->parserContext->getCurrentTextnode()->getText().$data); |
|
251 | + $this->parserContext->getCurrentTextnode()->setText($this->parserContext->getCurrentTextnode()->getText() . $data); |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 |
@@ -129,13 +129,13 @@ discard block |
||
129 | 129 | $this->prepare($input); |
130 | 130 | |
131 | 131 | if (file_exists($this->twineArchivePath) !== true) { |
132 | - $this->output->writeln("<error>Parameter 'twine-archive-file': File '".$this->twineArchivePath."' doesn't exist.</error>"); |
|
132 | + $this->output->writeln("<error>Parameter 'twine-archive-file': File '" . $this->twineArchivePath . "' doesn't exist.</error>"); |
|
133 | 133 | |
134 | 134 | return -1; |
135 | 135 | } |
136 | 136 | |
137 | 137 | if (is_readable($this->twineArchivePath) !== true) { |
138 | - $this->output->writeln("<error>Parameter 'twine-archive-file': File '".$this->twineArchivePath."' isn't readable.</error>"); |
|
138 | + $this->output->writeln("<error>Parameter 'twine-archive-file': File '" . $this->twineArchivePath . "' isn't readable.</error>"); |
|
139 | 139 | |
140 | 140 | return -1; |
141 | 141 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | $this->dm->flush(); |
157 | 157 | } catch (\Exception $ex) { |
158 | - $output->writeln('<error>'.$ex->getMessage().'</error>'); |
|
158 | + $output->writeln('<error>' . $ex->getMessage() . '</error>'); |
|
159 | 159 | |
160 | 160 | $importTwine->parserFree(); |
161 | 161 |