@@ -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 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $this->queryBuilder = $queryBuilder; |
| 38 | 38 | |
| 39 | 39 | // skip count during tests |
| 40 | - if(!is_null($filtered)){ |
|
| 40 | + if (!is_null($filtered)) { |
|
| 41 | 41 | $this->queryBuilder = $filtered; |
| 42 | 42 | $this->totalItem = (clone $filtered)->count()->getQuery()->execute(); |
| 43 | 43 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $qb = $this->queryBuilder; |
| 51 | 51 | $qb->skip($offset)->limit($itemCountPerPage); |
| 52 | 52 | return $qb->getQuery()->toArray(); |
| 53 | - }catch (\Exception $e){ |
|
| 53 | + } catch (\Exception $e) { |
|
| 54 | 54 | throw $e; |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -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); |
@@ -45,12 +45,12 @@ |
||
| 45 | 45 | } |
| 46 | 46 | */ |
| 47 | 47 | $setterMethods = array(); |
| 48 | - if(method_exists($object, 'getSetters')){ |
|
| 48 | + if (method_exists($object, 'getSetters')) { |
|
| 49 | 49 | $setterMethods = $object->getSetters(); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | foreach ($data as $key => $value) { |
| 53 | - $setter = 'set' . ucfirst($key); |
|
| 53 | + $setter = 'set'.ucfirst($key); |
|
| 54 | 54 | if (in_array($setter, $setterMethods)) { |
| 55 | 55 | $object->$setter($value); |
| 56 | 56 | } else { |
@@ -28,6 +28,6 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function getUri(): string |
| 30 | 30 | { |
| 31 | - return '/'.trim('file/Core.Images/' . $this->id . "/" . urlencode($this->name), '/'); |
|
| 31 | + return '/'.trim('file/Core.Images/'.$this->id."/".urlencode($this->name), '/'); |
|
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | \ No newline at end of file |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $images = $this->images; |
| 65 | 65 | $metadata = $image->getMetadata(); |
| 66 | - if(!is_null($current = $this->get($metadata->getKey(), false))){ |
|
| 66 | + if (!is_null($current = $this->get($metadata->getKey(), false))) { |
|
| 67 | 67 | $index = $images->indexOf($current); |
| 68 | 68 | $images->remove($index); |
| 69 | 69 | } |
@@ -73,14 +73,14 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | public function get(string $key, bool $fallback = true): ?ImageInterface |
| 75 | 75 | { |
| 76 | - foreach($this->images as $image){ |
|
| 77 | - try{ |
|
| 78 | - if(!is_null($metadata = $image->getMetadata())){ |
|
| 79 | - if($metadata->getKey() === $key){ |
|
| 76 | + foreach ($this->images as $image) { |
|
| 77 | + try { |
|
| 78 | + if (!is_null($metadata = $image->getMetadata())) { |
|
| 79 | + if ($metadata->getKey() === $key) { |
|
| 80 | 80 | return $image; |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | - }catch (\Exception $e){ |
|
| 83 | + } catch (\Exception $e) { |
|
| 84 | 84 | return null; |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | return $image; |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | - }catch (\Exception $e){ |
|
| 83 | + } catch (\Exception $e){ |
|
| 84 | 84 | return null; |
| 85 | 85 | } |
| 86 | 86 | } |