@@ -54,14 +54,14 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public function getAbsolutePath(): ?string |
| 56 | 56 | { |
| 57 | - return $this->fileName === null ? null : $this->getUploadRootDir() . '/' . $this->fileName; |
|
| 57 | + return $this->fileName === null ? null : $this->getUploadRootDir().'/'.$this->fileName; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public function getWebPath(): string |
| 61 | 61 | { |
| 62 | 62 | $file = $this->getAbsolutePath(); |
| 63 | 63 | if (is_file($file) && file_exists($file)) { |
| 64 | - return '/files/' . $this->getUploadDir() . '/' . $this->fileName; |
|
| 64 | + return '/files/'.$this->getUploadDir().'/'.$this->fileName; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | return ''; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | protected function getUploadRootDir(): string |
| 71 | 71 | { |
| 72 | 72 | // the absolute directory path where uploaded documents should be saved |
| 73 | - return __DIR__ . '/../../../../web/files/' . $this->getTrimmedUploadDir(); |
|
| 73 | + return __DIR__.'/../../../../web/files/'.$this->getTrimmedUploadDir(); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | protected function getTrimmedUploadDir(): string |
@@ -144,9 +144,9 @@ discard block |
||
| 144 | 144 | // do whatever you want to generate a unique name |
| 145 | 145 | $filename = sha1(uniqid(mt_rand(), true)); |
| 146 | 146 | if ($this->namePrefix !== null) { |
| 147 | - $filename = Urlizer::urlize($this->namePrefix) . '_' . $filename; |
|
| 147 | + $filename = Urlizer::urlize($this->namePrefix).'_'.$filename; |
|
| 148 | 148 | } |
| 149 | - $this->fileName = $filename . '.' . $this->getFile()->guessExtension(); |
|
| 149 | + $this->fileName = $filename.'.'.$this->getFile()->guessExtension(); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | protected function removeOldFile(): void |
| 177 | 177 | { |
| 178 | 178 | // delete the old file |
| 179 | - $oldFile = $this->getUploadRootDir() . '/' . $this->oldFileName; |
|
| 179 | + $oldFile = $this->getUploadRootDir().'/'.$this->oldFileName; |
|
| 180 | 180 | if (is_file($oldFile) && file_exists($oldFile)) { |
| 181 | 181 | unlink($oldFile); |
| 182 | 182 | } |