@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function getAbsolutePath() |
| 55 | 55 | { |
| 56 | - return $this->fileName === null ? null : $this->getUploadRootDir() . '/' . $this->fileName; |
|
| 56 | + return $this->fileName === null ? null : $this->getUploadRootDir().'/'.$this->fileName; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $file = $this->getAbsolutePath(); |
| 65 | 65 | if (is_file($file) && file_exists($file)) { |
| 66 | - return '/' . $this->getUploadDir() . '/' . $this->fileName; |
|
| 66 | + return '/'.$this->getUploadDir().'/'.$this->fileName; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | return ''; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | protected function getUploadRootDir() |
| 76 | 76 | { |
| 77 | 77 | // the absolute directory path where uploaded documents should be saved |
| 78 | - return __DIR__ . '/../../../../web/' . $this->getTrimmedUploadDir(); |
|
| 78 | + return __DIR__.'/../../../../web/'.$this->getTrimmedUploadDir(); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | // do whatever you want to generate a unique name |
| 152 | 152 | $filename = sha1(uniqid(mt_rand(), true)); |
| 153 | - $this->fileName = $filename . '.' . $this->getFile()->guessExtension(); |
|
| 153 | + $this->fileName = $filename.'.'.$this->getFile()->guessExtension(); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | // check if we have an old image |
| 168 | 168 | if ($this->oldFileName !== null) { |
| 169 | 169 | // delete the old image |
| 170 | - $oldFile = $this->getUploadRootDir() . '/' . $this->oldFileName; |
|
| 170 | + $oldFile = $this->getUploadRootDir().'/'.$this->oldFileName; |
|
| 171 | 171 | if (is_file($oldFile) && file_exists($oldFile)) { |
| 172 | 172 | unlink($oldFile); |
| 173 | 173 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $builder |
| 32 | 32 | ->addEventListener( |
| 33 | 33 | FormEvents::PRE_SET_DATA, |
| 34 | - function (FormEvent $event) use ($options) { |
|
| 34 | + function(FormEvent $event) use ($options) { |
|
| 35 | 35 | $event->getForm()->add( |
| 36 | 36 | 'file', |
| 37 | 37 | SymfonyFileType::class, |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | ) |
| 62 | 62 | ->addModelTransformer( |
| 63 | 63 | new CallbackTransformer( |
| 64 | - function (AbstractImage $image = null) { |
|
| 64 | + function(AbstractImage $image = null) { |
|
| 65 | 65 | return $image; |
| 66 | 66 | }, |
| 67 | - function (AbstractImage $image = null) use ($options) { |
|
| 67 | + function(AbstractImage $image = null) use ($options) { |
|
| 68 | 68 | if ($image === null) { |
| 69 | 69 | $imageClass = $options['image_class']; |
| 70 | 70 | if ($this->removeField !== null && $this->removeField->getData()) { |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $builder |
| 32 | 32 | ->addEventListener( |
| 33 | 33 | FormEvents::PRE_SET_DATA, |
| 34 | - function (FormEvent $event) use ($options) { |
|
| 34 | + function(FormEvent $event) use ($options) { |
|
| 35 | 35 | $event->getForm()->add( |
| 36 | 36 | 'file', |
| 37 | 37 | SymfonyFileType::class, |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | ) |
| 62 | 62 | ->addModelTransformer( |
| 63 | 63 | new CallbackTransformer( |
| 64 | - function (AbstractFile $file = null) { |
|
| 64 | + function(AbstractFile $file = null) { |
|
| 65 | 65 | return $file; |
| 66 | 66 | }, |
| 67 | - function (AbstractFile $file = null) use ($options) { |
|
| 67 | + function(AbstractFile $file = null) use ($options) { |
|
| 68 | 68 | if ($file === null) { |
| 69 | 69 | $fileClass = $options['file_class']; |
| 70 | 70 | if ($this->removeField !== null && $this->removeField->getData()) { |