Completed
Pull Request — master (#168)
by
unknown
02:59
created
Controller/SettingsManagerController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
ONGRSettingsBundle.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
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.
Please login to merge, or discard this patch.
Service/FormValidator.php 1 patch
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,28 +39,27 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Controller/ProfileController.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.