@@ -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 | /** |
@@ -181,9 +181,9 @@ |
||
| 181 | 181 | private function getSetting($name, $type, $value, $profile = 'default') |
| 182 | 182 | { |
| 183 | 183 | $setting = new Setting(); |
| 184 | - $setting->setId($profile . '_' . $name); |
|
| 184 | + $setting->setId($profile.'_'.$name); |
|
| 185 | 185 | $setting->setName($name); |
| 186 | - $setting->setDescription('ongr_settings.' . $name); |
|
| 186 | + $setting->setDescription('ongr_settings.'.$name); |
|
| 187 | 187 | $setting->setProfile($profile); |
| 188 | 188 | $setting->setType($type); |
| 189 | 189 | $setting->setData(['value' => $value]); |
@@ -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. |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | namespace ONGR\SettingsBundle\Tests\Functional\Controller; |
| 13 | 13 | |
| 14 | 14 | use ONGR\ElasticsearchBundle\Test\AbstractElasticsearchTestCase; |
| 15 | -use ONGR\SettingsBundle\Tests\Fixtures\Security\LoginTestHelper; |
|
| 16 | 15 | use Symfony\Bundle\FrameworkBundle\Client; |
| 17 | 16 | |
| 18 | 17 | /** |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | foreach ($profiles as $profile) { |
| 76 | 76 | $setting = new Setting(); |
| 77 | - $setting->setId($profile . '_' . $name); |
|
| 77 | + $setting->setId($profile.'_'.$name); |
|
| 78 | 78 | $setting->setName($name); |
| 79 | 79 | $setting->setDescription($description); |
| 80 | 80 | $setting->setData((object)['value' => $value]); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | foreach ($newProfiles as $profile) { |
| 131 | 131 | $newSetting = clone $setting; |
| 132 | 132 | |
| 133 | - $newSetting->setId($profile . '_' . $setting->getName()); |
|
| 133 | + $newSetting->setId($profile.'_'.$setting->getName()); |
|
| 134 | 134 | $newSetting->setProfile($profile); |
| 135 | 135 | $newSettings[] = $newSetting; |
| 136 | 136 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function get($name, $profile = 'default', $mustExist = true, $type = 'string') |
| 154 | 154 | { |
| 155 | - $setting = $this->repo->find($profile . '_' . $name); |
|
| 155 | + $setting = $this->repo->find($profile.'_'.$name); |
|
| 156 | 156 | if ($setting === null) { |
| 157 | 157 | if ($mustExist === true) { |
| 158 | 158 | throw new \UnexpectedValueException(); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | protected function createSetting($name, $profile, $type) |
| 176 | 176 | { |
| 177 | 177 | $setting = new Setting(); |
| 178 | - $setting->setId($profile . '_' . $name); |
|
| 178 | + $setting->setId($profile.'_'.$name); |
|
| 179 | 179 | $setting->setName($name); |
| 180 | 180 | $setting->setProfile($profile); |
| 181 | 181 | $setting->setType($type); |
@@ -82,6 +82,6 @@ |
||
| 82 | 82 | */ |
| 83 | 83 | protected function guessName($setting) |
| 84 | 84 | { |
| 85 | - return 'set' . Container::camelize($setting); |
|
| 85 | + return 'set'.Container::camelize($setting); |
|
| 86 | 86 | } |
| 87 | 87 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | |
| 58 | 58 | $settings = []; |
| 59 | 59 | foreach ($profiles as $profile) { |
| 60 | - $profileId = 'ongr_settings_profile_' . UnderscoreEscaper::escape($profile['name']); |
|
| 60 | + $profileId = 'ongr_settings_profile_'.UnderscoreEscaper::escape($profile['name']); |
|
| 61 | 61 | $settings[$profileId] = [ |
| 62 | 62 | 'name' => $profile['name'], |
| 63 | 63 | 'category' => 'ongr_settings_profiles', |