@@ -15,7 +15,7 @@ |
||
| 15 | 15 | /** @var RouteRepository */ |
| 16 | 16 | private $routeRepository; |
| 17 | 17 | |
| 18 | - public function __construct ( |
|
| 18 | + public function __construct( |
|
| 19 | 19 | RouteRepository $routeRepository |
| 20 | 20 | ) |
| 21 | 21 | { |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $this->em = $em; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - private function getRealPath ($filename): string |
|
| 33 | + private function getRealPath($filename): string |
|
| 34 | 34 | { |
| 35 | 35 | return rtrim($this->rootPath, '/') . '/' . $filename; |
| 36 | 36 | } |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $ext = $file->guessExtension(); |
| 43 | 43 | $basename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME); |
| 44 | - $filename = $basename.'.'.$ext; |
|
| 45 | - $i=0; |
|
| 46 | - while($fs->exists($this->getRealPath($filename))) { |
|
| 44 | + $filename = $basename . '.' . $ext; |
|
| 45 | + $i = 0; |
|
| 46 | + while ($fs->exists($this->getRealPath($filename))) { |
|
| 47 | 47 | $i++; |
| 48 | - $filename = $basename.".$i.$ext"; |
|
| 48 | + $filename = $basename . ".$i.$ext"; |
|
| 49 | 49 | } |
| 50 | 50 | return $filename; |
| 51 | 51 | } |
@@ -81,9 +81,9 @@ |
||
| 81 | 81 | $files = $request->files->all(); |
| 82 | 82 | try { |
| 83 | 83 | $entity = $this->uploader->upload($entity, $field, reset($files)); |
| 84 | - }catch(InvalidArgumentException $exception) { |
|
| 84 | + } catch (InvalidArgumentException $exception) { |
|
| 85 | 85 | return new Response($exception->getMessage(), Response::HTTP_BAD_REQUEST); |
| 86 | - }catch (RuntimeException $exception) { |
|
| 86 | + } catch (RuntimeException $exception) { |
|
| 87 | 87 | return new Response($exception->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -81,9 +81,9 @@ |
||
| 81 | 81 | $files = $request->files->all(); |
| 82 | 82 | try { |
| 83 | 83 | $entity = $this->uploader->upload($entity, $field, reset($files)); |
| 84 | - }catch(InvalidArgumentException $exception) { |
|
| 84 | + } catch(InvalidArgumentException $exception) { |
|
| 85 | 85 | return new Response($exception->getMessage(), Response::HTTP_BAD_REQUEST); |
| 86 | - }catch (RuntimeException $exception) { |
|
| 86 | + } catch (RuntimeException $exception) { |
|
| 87 | 87 | return new Response($exception->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR); |
| 88 | 88 | } |
| 89 | 89 | |