@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $builder |
28 | 28 | ->addEventListener( |
29 | 29 | FormEvents::PRE_SET_DATA, |
30 | - function (FormEvent $event) { |
|
30 | + function(FormEvent $event) { |
|
31 | 31 | $event->getForm()->add( |
32 | 32 | 'file', |
33 | 33 | SymfonyFileType::class, |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | ) |
44 | 44 | ->addModelTransformer( |
45 | 45 | new CallbackTransformer( |
46 | - function (AbstractFile $file = null) { |
|
46 | + function(AbstractFile $file = null) { |
|
47 | 47 | return $file; |
48 | 48 | }, |
49 | - function (AbstractFile $file = null) use ($options) { |
|
49 | + function(AbstractFile $file = null) use ($options) { |
|
50 | 50 | if ($file === null) { |
51 | 51 | $fileClass = $options['file_class']; |
52 | 52 |
@@ -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 | } |