@@ -25,7 +25,7 @@ |
||
25 | 25 | $this->root_path = $root_path; |
26 | 26 | $this->web_path = $web_path; |
27 | 27 | |
28 | - parent::__construct($root_path . $web_path); |
|
28 | + parent::__construct($root_path.$web_path); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -25,7 +25,7 @@ |
||
25 | 25 | if (isset($config['root_path']) && !empty($config['root_path'])) { |
26 | 26 | $root_path = rtrim($config['root_path'], '/'); |
27 | 27 | } else { |
28 | - $root_path = $container->getParameter('kernel.root_dir') .'/../web'; |
|
28 | + $root_path = $container->getParameter('kernel.root_dir').'/../web'; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | $container->setParameter('fenrizbes_uploadable.root_path', $root_path); |
@@ -23,8 +23,7 @@ discard block |
||
23 | 23 | public function getExtendedType() { |
24 | 24 | if(static::isLegacy()) { |
25 | 25 | return FileType::class; |
26 | - } |
|
27 | - else { |
|
26 | + } else { |
|
28 | 27 | return 'file'; |
29 | 28 | } |
30 | 29 | } |
@@ -46,8 +45,7 @@ discard block |
||
46 | 45 | if(method_exists($object, 'setOriginalFileName')) { |
47 | 46 | $object->setOriginalFileName($fieldName, $fileData->getClientOriginalName()); |
48 | 47 | } |
49 | - } |
|
50 | - else { |
|
48 | + } else { |
|
51 | 49 | if(is_array($event->getForm()->getData())) { |
52 | 50 | foreach($event->getForm()->getData() as $key => $item) { |
53 | 51 | if(method_exists($item, 'setOriginalFileName')) { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | class FileNameTypeExtension extends AbstractTypeExtension |
23 | 23 | { |
24 | 24 | public function getExtendedType() { |
25 | - if(static::isLegacy()) { |
|
25 | + if (static::isLegacy()) { |
|
26 | 26 | return FileType::class; |
27 | 27 | } |
28 | 28 | else { |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | $fileData = $event->getData(); |
44 | 44 | |
45 | 45 | $object = $event->getForm()->getParent()->getData(); |
46 | - if(!$event->getForm()->getConfig()->getOption('multiple')) { |
|
47 | - if(method_exists($object, 'setOriginalFileName') && $fileData instanceof UploadedFile) { |
|
46 | + if (!$event->getForm()->getConfig()->getOption('multiple')) { |
|
47 | + if (method_exists($object, 'setOriginalFileName') && $fileData instanceof UploadedFile) { |
|
48 | 48 | $object->setOriginalFileName($fieldName, $fileData->getClientOriginalName()); |
49 | 49 | } |
50 | 50 | } |
51 | 51 | else { |
52 | - if(is_array($event->getForm()->getData())) { |
|
53 | - foreach($event->getForm()->getData() as $key => $item) { |
|
54 | - if(method_exists($item, 'setOriginalFileName') && $fileData[$key] instanceof UploadedFile) { |
|
52 | + if (is_array($event->getForm()->getData())) { |
|
53 | + foreach ($event->getForm()->getData() as $key => $item) { |
|
54 | + if (method_exists($item, 'setOriginalFileName') && $fileData[$key] instanceof UploadedFile) { |
|
55 | 55 | $item->setOriginalFileName($fieldName, $fileData[$key]->getClientOriginalName()); //$item->getClientOriginalName() |
56 | 56 | } |
57 | 57 | } |