@@ -33,11 +33,10 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | $uploadDirectory = (!isset($config['obblm.upload_directory'])) ? |
36 | - $uploadDirectory = $container->getParameter('kernel.project_dir') . '/public/uploads/obblm' : |
|
37 | - $config['obblm.upload_directory']; |
|
36 | + $uploadDirectory = $container->getParameter('kernel.project_dir') . '/public/uploads/obblm' : $config['obblm.upload_directory']; |
|
38 | 37 | $container->setParameter('obblm.config.upload_directory', $uploadDirectory); |
39 | 38 | |
40 | - $locator = new FileLocator(dirname(__DIR__).'/Resources/config'); |
|
39 | + $locator = new FileLocator(dirname(__DIR__) . '/Resources/config'); |
|
41 | 40 | $loader = new YamlFileLoader($container, $locator); |
42 | 41 | $loader->load('services.yaml'); |
43 | 42 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | try { |
30 | 30 | $filesystem->remove($this->getObjectDirectory() . '/' . $filename); |
31 | 31 | } catch (IOExceptionInterface $exception) { |
32 | - echo "An error occurred while creating your directory at ".$exception->getPath(); |
|
32 | + echo "An error occurred while creating your directory at " . $exception->getPath(); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | public function setObjectSubDirectory(string $uploadDirectory): self |
47 | 47 | { |
48 | - $this->uploadDirectory = $this->targetDirectory .'/' . $uploadDirectory; |
|
48 | + $this->uploadDirectory = $this->targetDirectory . '/' . $uploadDirectory; |
|
49 | 49 | return $this; |
50 | 50 | } |
51 | 51 | |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | * @param UploadedFile $file |
54 | 54 | * @return File|null |
55 | 55 | */ |
56 | - public function upload(UploadedFile $file):?File |
|
56 | + public function upload(UploadedFile $file): ?File |
|
57 | 57 | { |
58 | 58 | $originalFilename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME); |
59 | 59 | $safeFilename = $this->slugger->slug($originalFilename); |
60 | - $fileName = $safeFilename.'-'.uniqid().'.'.$file->guessExtension(); |
|
60 | + $fileName = $safeFilename . '-' . uniqid() . '.' . $file->guessExtension(); |
|
61 | 61 | |
62 | 62 | try { |
63 | 63 | $newFile = $file->move($this->getObjectDirectory(), $fileName); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | return null; |
30 | 30 | } |
31 | 31 | |
32 | - public function uploadLogoIfExists(Team $object, $logoFile):?File |
|
32 | + public function uploadLogoIfExists(Team $object, $logoFile): ?File |
|
33 | 33 | { |
34 | 34 | if ($logoFile) { |
35 | 35 | $this->setObjectSubDirectory($object->getId()); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | return null; |
46 | 46 | } |
47 | - public function uploadCoverIfExists(Team $object, $coverFile):?File |
|
47 | + public function uploadCoverIfExists(Team $object, $coverFile): ?File |
|
48 | 48 | { |
49 | 49 | if ($coverFile) { |
50 | 50 | $this->setObjectSubDirectory($object->getId()); |