@@ -54,7 +54,7 @@ |
||
54 | 54 | public function getImageFormat(): ?string |
55 | 55 | { |
56 | 56 | $format = null; |
57 | - if(!is_null($this->contentType)){ |
|
57 | + if (!is_null($this->contentType)) { |
|
58 | 58 | $format = str_replace('image/', '', $this->contentType); |
59 | 59 | } |
60 | 60 | return $format; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | list($module, $entityName) = explode('.', $fileStoreName); |
76 | 76 | $response = $this->getResponse(); |
77 | 77 | $fileManager = $this->fileManager; |
78 | - $entityClass = $module . '\\Entity\\' . $entityName; |
|
78 | + $entityClass = $module.'\\Entity\\'.$entityName; |
|
79 | 79 | $fileId = $this->params('fileId', 0); |
80 | 80 | |
81 | 81 | if (preg_match('/^(.*)\..*$/', $fileId, $baseFileName)) { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $events = $this->coreFileEvents; |
150 | 150 | $event = $events->getEvent(FileEvent::EVENT_DELETE, $this, ['file' => $file]); |
151 | 151 | |
152 | - $events->triggerEventUntil(function ($r) { |
|
152 | + $events->triggerEventUntil(function($r) { |
|
153 | 153 | return true === $r; |
154 | 154 | }, $event); |
155 | 155 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | |
58 | 58 | $metadata = $file->getMetadata(); |
59 | 59 | $response->getHeaders()->addHeaderline('Content-Type', $metadata->getContentType()) |
60 | - ->addHeaderline('Content-Length', $file->getLength()); |
|
60 | + ->addHeaderline('Content-Length', $file->getLength()); |
|
61 | 61 | $response->sendHeaders(); |
62 | 62 | |
63 | 63 | $resource = $fileManager->getStream($file); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $qb = $this->queryBuilder; |
49 | 49 | $qb->skip($offset)->limit($itemCountPerPage); |
50 | 50 | return $qb->getQuery()->toArray(); |
51 | - }catch (\Exception $e){ |
|
51 | + } catch (\Exception $e) { |
|
52 | 52 | throw $e; |
53 | 53 | } |
54 | 54 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $qb = $this->queryBuilder; |
49 | 49 | $qb->skip($offset)->limit($itemCountPerPage); |
50 | 50 | return $qb->getQuery()->toArray(); |
51 | - }catch (\Exception $e){ |
|
51 | + } catch (\Exception $e){ |
|
52 | 52 | throw $e; |
53 | 53 | } |
54 | 54 | } |
@@ -27,6 +27,6 @@ |
||
27 | 27 | $coreFileEvents = $container->get('Core/File/Events'); |
28 | 28 | $fileManager = $container->get(FileManager::class); |
29 | 29 | |
30 | - return new FileController($fileManager,$coreFileEvents); |
|
30 | + return new FileController($fileManager, $coreFileEvents); |
|
31 | 31 | } |
32 | 32 | } |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | $configArray = array_merge($configArray, $mails); |
50 | 50 | |
51 | 51 | $config = new MailServiceConfig($configArray); |
52 | - $service = new MailService($container, $config->toArray()); |
|
52 | + $service = new MailService($container, $config->toArray()); |
|
53 | 53 | $config->configureServiceManager($service); |
54 | 54 | foreach ($config->toArray() as $name=>$value) { |
55 | 55 | $method = 'set'.$name; |
56 | 56 | if (method_exists($service, $method)) { |
57 | - call_user_func([$service,$method], $value); |
|
57 | + call_user_func([$service, $method], $value); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } elseif (MailService::TRANSPORT_FILE == $type) { |
72 | 72 | $fileOptions = new FileOptions(); |
73 | 73 | $path = $mailServiceOptions->getPath(); |
74 | - if(!is_dir($path)){ |
|
74 | + if (!is_dir($path)) { |
|
75 | 75 | mkdir($path, true); |
76 | 76 | } |
77 | 77 |
@@ -21,5 +21,5 @@ |
||
21 | 21 | |
22 | 22 | public function add(ImageInterface $image): self; |
23 | 23 | |
24 | - public function get(string $key, bool $fallback=true): ?ImageInterface; |
|
24 | + public function get(string $key, bool $fallback = true): ?ImageInterface; |
|
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -38,7 +38,7 @@ |
||
38 | 38 | User $user, |
39 | 39 | string $metadataClass, |
40 | 40 | string $entityClass |
41 | - ){ |
|
41 | + ) { |
|
42 | 42 | |
43 | 43 | $this->user = $user; |
44 | 44 | $this->metadataClass = $metadataClass; |
@@ -71,9 +71,9 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $data = $data['original']; |
74 | - $file = $data['tmp_name']; |
|
74 | + $file = $data['tmp_name']; |
|
75 | 75 | |
76 | - if(!is_readable($file)){ |
|
76 | + if (!is_readable($file)) { |
|
77 | 77 | throw new \Exception("File '$file' is unreadable."); |
78 | 78 | } |
79 | 79 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | /* @var ImageInterface $image */ |
99 | - foreach($images as $key => $image) { |
|
99 | + foreach ($images as $key => $image) { |
|
100 | 100 | $object->add($image); |
101 | 101 | } |
102 | 102 | |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | /* @var \Core\Entity\ImageMetadata $metadata */ |
139 | 139 | $metadata = $this->options->getMetadata(); |
140 | 140 | $fileManager = $this->fileManager; |
141 | - $name = ($prefix ? "$prefix-" : '') . $data['name']; |
|
142 | - $key = "" == $prefix ? "original":$prefix; |
|
141 | + $name = ($prefix ? "$prefix-" : '').$data['name']; |
|
142 | + $key = "" == $prefix ? "original" : $prefix; |
|
143 | 143 | $metadata->setContentType($data['type']); |
144 | 144 | $metadata->setBelongsTo($imageSetId); |
145 | 145 | $metadata->setKey($key); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | if (is_string($image)) { |
149 | 149 | $file = $image; |
150 | - }else{ |
|
150 | + } else { |
|
151 | 151 | $format = str_replace('image/', '', $data['type']); |
152 | 152 | $content = $image->get($format); |
153 | 153 | $file = '/tmp/php'.md5($content); |
@@ -147,7 +147,7 @@ |
||
147 | 147 | |
148 | 148 | if (is_string($image)) { |
149 | 149 | $file = $image; |
150 | - }else{ |
|
150 | + } else{ |
|
151 | 151 | $format = str_replace('image/', '', $data['type']); |
152 | 152 | $content = $image->get($format); |
153 | 153 | $file = '/tmp/php'.md5($content); |