@@ -60,7 +60,7 @@ |
||
60 | 60 | // elements comes out reversed compared to original. |
61 | 61 | uasort( |
62 | 62 | $providers, |
63 | - function ($a, $b) { |
|
63 | + function($a, $b) { |
|
64 | 64 | if ($a['priority'] == $b['priority']) { |
65 | 65 | return 0; |
66 | 66 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
44 | - * @return array |
|
44 | + * @return \Twig_SimpleFunction[] |
|
45 | 45 | */ |
46 | 46 | public function getFunctions() |
47 | 47 | { |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * @param string $settingName |
61 | 61 | * @param bool $mustAuthorize |
62 | 62 | * |
63 | - * @return mixed |
|
63 | + * @return boolean |
|
64 | 64 | */ |
65 | 65 | public function getSettingEnabled($settingName, $mustAuthorize = true) |
66 | 66 | { |
@@ -161,7 +161,7 @@ |
||
161 | 161 | * |
162 | 162 | * @param string $name |
163 | 163 | * @param string $type |
164 | - * @param mixed $value |
|
164 | + * @param string $value |
|
165 | 165 | * @param string $profile |
166 | 166 | * |
167 | 167 | * @return Setting |
@@ -16,7 +16,6 @@ |
||
16 | 16 | use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; |
17 | 17 | use ONGR\ElasticsearchBundle\Service\Manager; |
18 | 18 | use ONGR\ElasticsearchDSL\Query\MatchAllQuery; |
19 | -use Symfony\Component\Translation\TranslatorInterface; |
|
20 | 19 | use Symfony\Component\DependencyInjection\ContainerInterface; |
21 | 20 | |
22 | 21 | /** |
@@ -26,7 +26,7 @@ |
||
26 | 26 | public function getFilters() |
27 | 27 | { |
28 | 28 | return [ |
29 | - 'base64Encode' => new \Twig_SimpleFilter('base64Encode', [$this,'base64EncodeFilter']) |
|
29 | + 'base64Encode' => new \Twig_SimpleFilter('base64Encode', [$this, 'base64EncodeFilter']) |
|
30 | 30 | ]; |
31 | 31 | } |
32 | 32 |
@@ -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 | } |