Skip to content

Commit 4202cb8

Browse files
authored
Apply fixes from StyleCI (#435)
Co-authored-by: Al Ganiev <[email protected]>
1 parent f9f6305 commit 4202cb8

File tree

3 files changed

+16
-27
lines changed

3 files changed

+16
-27
lines changed

src/Controller/ElFinderController.php

+4-13
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,11 @@ public function show(Request $request, string $instance, string $homeFolder): Re
4444
return $this->render($result['template'], $result['params']);
4545
}
4646

47-
/**
48-
* @param array $parameters
49-
* @param string $instance
50-
* @param string $homeFolder
51-
* @param string $assetsPath
52-
* @param string|null $formTypeId
53-
*
54-
* @return array
55-
*
56-
* @throws Exception
57-
*/
47+
/**
48+
* @throws Exception
49+
*/
5850
private function selectEditor(array $parameters, string $instance, string $homeFolder, string $assetsPath, string $formTypeId = null): array
5951
{
60-
6152
$editor = $parameters['editor'];
6253
$locale = $parameters['locale'] ?: $this->container->getParameter('locale');
6354
$fullScreen = $parameters['fullscreen'];
@@ -199,7 +190,7 @@ private function selectEditor(array $parameters, string $instance, string $homeF
199190
public function load(SessionInterface $session, EventDispatcherInterface $eventDispatcher, Request $request, string $instance, string $homeFolder): JsonResponse
200191
{
201192
$efParameters = $this->container->getParameter('fm_elfinder');
202-
$loader = $this->get('fm_elfinder.loader');
193+
$loader = $this->get('fm_elfinder.loader');
203194
$loader->initBridge($instance, $efParameters); // builds up the Bridge object for the loader with the given instance
204195

205196
if ($loader instanceof ElFinderLoader) {

src/Loader/ElFinderLoader.php

+9-11
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,22 @@ public function initBridge($instance, array $efParameters)
5959
{
6060
$this->setInstance($instance);
6161

62-
$arrayInstance = $efParameters['instances'][$instance];
63-
$whereIsMulti = $arrayInstance['where_is_multi'];
64-
$multiHome = $arrayInstance['multi_home_folder'];
65-
$separator = $arrayInstance['folder_separator'];
62+
$arrayInstance = $efParameters['instances'][$instance];
63+
$whereIsMulti = $arrayInstance['where_is_multi'];
64+
$multiHome = $arrayInstance['multi_home_folder'];
65+
$separator = $arrayInstance['folder_separator'];
6666

6767
$this->config = $this->configure();
68-
69-
if (count($whereIsMulti) > 0)
70-
{
71-
foreach($whereIsMulti as $key => $value)
72-
{
68+
69+
if (count($whereIsMulti) > 0) {
70+
foreach ($whereIsMulti as $key => $value) {
7371
if ($multiHome) {
7472
$this->config[$key][$value]['path'] = str_replace($separator, '/', $this->config[$key][$value]['path']);
75-
$this->config[$key][$value]['URL'] = str_replace($separator, '/', $this->config[$key][$value]['URL']);
73+
$this->config[$key][$value]['URL'] = str_replace($separator, '/', $this->config[$key][$value]['URL']);
7674
}
7775
}
7876
}
79-
77+
8078
$this->bridge = new ElFinderBridge($this->config);
8179
if ($this->session) {
8280
$this->bridge->setSession($this->session);

tests/DependencyInjection/ConfigurationLoadTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public function testSupportsAllConfigFormats($path)
4040
'theme' => 'smoothness',
4141
'editor_template' => 'Elfinder/editor.html.twig',
4242
'fullscreen' => false,
43-
'where_is_multi' => array(),
44-
'multi_home_folder' => false,
45-
'folder_separator' => '',
43+
'where_is_multi' => [],
44+
'multi_home_folder' => false,
45+
'folder_separator' => '',
4646
'cors_support' => false,
4747
'tinymce_popup_path' => '/pop-up',
4848
'relative_path' => false,

0 commit comments

Comments
 (0)