@@ -13,7 +13,6 @@ |
||
13 | 13 | |
14 | 14 | use ONGR\SettingsBundle\Settings\General\SettingsManager; |
15 | 15 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
16 | -use Symfony\Component\HttpFoundation\JsonResponse; |
|
17 | 16 | use Symfony\Component\HttpFoundation\RedirectResponse; |
18 | 17 | use Symfony\Component\HttpFoundation\Request; |
19 | 18 | use Symfony\Component\HttpFoundation\Response; |
@@ -17,7 +17,6 @@ |
||
17 | 17 | use ONGR\SettingsBundle\DependencyInjection\Compiler\SettingAwareFactoryPass; |
18 | 18 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
19 | 19 | use Symfony\Component\HttpKernel\Bundle\Bundle; |
20 | -use ONGR\SettingsBundle\DependencyInjection\Security\SessionlessAuthenticationFactory; |
|
21 | 20 | |
22 | 21 | /** |
23 | 22 | * This class is used to register component into Symfony app kernel. |
@@ -39,28 +39,27 @@ discard block |
||
39 | 39 | $return['error'] = 'You must set a name to the setting. '; |
40 | 40 | } |
41 | 41 | if (count($return['profiles']) == 0) { |
42 | - $return['error'] = $return['error'].'At least 1 profile has to be set. '; |
|
42 | + $return['error'] = $return['error'] . 'At least 1 profile has to be set. '; |
|
43 | 43 | } |
44 | 44 | switch ($return['type']) { |
45 | 45 | case 'bool': |
46 | 46 | $request->request->get('setting-boolean') == 'true' ? |
47 | - $return['value'] = true : |
|
48 | - $return['value'] = false; |
|
47 | + $return['value'] = true : $return['value'] = false; |
|
49 | 48 | break; |
50 | 49 | case 'string': |
51 | 50 | $return['value'] = $request->request->get('setting-default'); |
52 | 51 | if ($return['value'] == '') { |
53 | - $return['error'] = $return['error'].'You must set a value to the setting. '; |
|
52 | + $return['error'] = $return['error'] . 'You must set a value to the setting. '; |
|
54 | 53 | } |
55 | 54 | break; |
56 | 55 | case 'object': |
57 | 56 | try { |
58 | 57 | $return['value'] = json_encode($parser->parse($request->request->get('setting-object'))); |
59 | 58 | } catch (\Exception $e) { |
60 | - $return['error'] = $return['error'].'Passed setting value does not contain valid yaml. '; |
|
59 | + $return['error'] = $return['error'] . 'Passed setting value does not contain valid yaml. '; |
|
61 | 60 | } |
62 | 61 | if ($return['value'] == '') { |
63 | - $return['error'] = $return['error'].'You must set a value to the setting. '; |
|
62 | + $return['error'] = $return['error'] . 'You must set a value to the setting. '; |
|
64 | 63 | } |
65 | 64 | break; |
66 | 65 | case 'array': |
@@ -71,7 +70,7 @@ discard block |
||
71 | 70 | } |
72 | 71 | } |
73 | 72 | if (count($return['value']) == 0 || $return['value'][0] == '') { |
74 | - $return['error'] = $return['error'].'You must set a value to the setting. '; |
|
73 | + $return['error'] = $return['error'] . 'You must set a value to the setting. '; |
|
75 | 74 | } |
76 | 75 | break; |
77 | 76 | } |
@@ -100,7 +99,7 @@ discard block |
||
100 | 99 | } |
101 | 100 | foreach ($profiles as $profile) { |
102 | 101 | if ($return['name'] == $profile['name']) { |
103 | - $return['error'] = 'The profile `'.$profile['name'].'` is already set.'; |
|
102 | + $return['error'] = 'The profile `' . $profile['name'] . '` is already set.'; |
|
104 | 103 | return $return; |
105 | 104 | } |
106 | 105 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | } |
64 | 64 | try { |
65 | 65 | $profileManager->createProfile($data['name'], $data['description']); |
66 | - }catch (\Exception $e) { |
|
66 | + } catch (\Exception $e) { |
|
67 | 67 | $cache->save('settings_errors', $e->getMessage()); |
68 | 68 | return new RedirectResponse($this->generateUrl('ongr_settings_profile_add')); |
69 | 69 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | } |
64 | 64 | try { |
65 | 65 | $profileManager->createProfile($data['name'], $data['description']); |
66 | - }catch (\Exception $e) { |
|
66 | + } catch (\Exception $e) { |
|
67 | 67 | $cache->save('settings_errors', $e->getMessage()); |
68 | 68 | return new RedirectResponse($this->generateUrl('ongr_settings_profile_add')); |
69 | 69 | } |