@@ -40,7 +40,7 @@ |
||
| 40 | 40 | // Set profiles. |
| 41 | 41 | $container->setParameter('ongr_settings.settings_container.profiles', $config['profiles']); |
| 42 | 42 | |
| 43 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 43 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 44 | 44 | $loader->load('services/twig_extension.yml'); |
| 45 | 45 | $loader->load('services/personal_settings.yml'); |
| 46 | 46 | $loader->load('services/general_settings.yml'); |
@@ -46,6 +46,6 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | public function registerContainerConfiguration(LoaderInterface $loader) |
| 48 | 48 | { |
| 49 | - $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml'); |
|
| 49 | + $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); |
|
| 50 | 50 | } |
| 51 | 51 | } |
@@ -11,9 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | namespace ONGR\SettingsBundle\Controller; |
| 13 | 13 | |
| 14 | -use ONGR\ElasticsearchBundle\Result\Aggregation\AggregationValue; |
|
| 15 | 14 | use ONGR\ElasticsearchBundle\Service\Repository; |
| 16 | -use ONGR\ElasticsearchDSL\Aggregation\TermsAggregation; |
|
| 17 | 15 | use ONGR\SettingsBundle\Document\Setting; |
| 18 | 16 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
| 19 | 17 | use Symfony\Component\HttpFoundation\JsonResponse; |
@@ -71,7 +71,6 @@ |
||
| 71 | 71 | /** |
| 72 | 72 | * Returns a json list of profiles |
| 73 | 73 | * |
| 74 | - * @param Request $request |
|
| 75 | 74 | * |
| 76 | 75 | * @return Response |
| 77 | 76 | */ |
@@ -65,7 +65,9 @@ |
||
| 65 | 65 | $profiles[] = $agg->getValue('key'); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - if (empty($profiles) || !in_array('default', $profiles)) array_unshift($profiles, 'default'); |
|
| 68 | + if (empty($profiles) || !in_array('default', $profiles)) { |
|
| 69 | + array_unshift($profiles, 'default'); |
|
| 70 | + } |
|
| 69 | 71 | |
| 70 | 72 | return new JsonResponse($profiles); |
| 71 | 73 | } |
@@ -14,11 +14,7 @@ |
||
| 14 | 14 | use ONGR\ElasticsearchBundle\Result\DocumentIterator; |
| 15 | 15 | use ONGR\ElasticsearchBundle\Service\Repository; |
| 16 | 16 | use ONGR\ElasticsearchDSL\Aggregation\TermsAggregation; |
| 17 | -use ONGR\ElasticsearchDSL\Aggregation\TopHitsAggregation; |
|
| 18 | -use ONGR\ElasticsearchDSL\Search; |
|
| 19 | 17 | use ONGR\ElasticsearchBundle\Result\Aggregation\AggregationValue; |
| 20 | -use ONGR\SettingsBundle\Document\Setting; |
|
| 21 | -use ONGR\SettingsBundle\Service\SettingsManager; |
|
| 22 | 18 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
| 23 | 19 | use Symfony\Component\HttpFoundation\JsonResponse; |
| 24 | 20 | use Symfony\Component\HttpFoundation\Request; |
@@ -150,7 +150,7 @@ |
||
| 150 | 150 | /** |
| 151 | 151 | * Set profile. |
| 152 | 152 | * |
| 153 | - * @param string|array $profile |
|
| 153 | + * @param string[] $profile |
|
| 154 | 154 | */ |
| 155 | 155 | public function setProfile($profile) |
| 156 | 156 | { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | 'value' => 'foo', |
| 112 | 112 | ]; |
| 113 | 113 | |
| 114 | - $this->manager->expects($this->once())->method('persist')->with($this->callback(function ($obj) {return $obj instanceof Setting;}))->willReturn(null); |
|
| 114 | + $this->manager->expects($this->once())->method('persist')->with($this->callback(function($obj) {return $obj instanceof Setting; }))->willReturn(null); |
|
| 115 | 115 | $this->manager->expects($this->once())->method('persist')->willReturn(null); |
| 116 | 116 | |
| 117 | 117 | $manager = new SettingsManager($this->repository, $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface')); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | $activeProfilesSetting = 'active_profiles'; |
| 384 | 384 | |
| 385 | 385 | $this->repository->expects($this->any())->method('findOneBy')->willReturnCallback( |
| 386 | - function ($arg) use ($activeProfilesSetting) { |
|
| 386 | + function($arg) use ($activeProfilesSetting) { |
|
| 387 | 387 | $settingName = $arg['name']; |
| 388 | 388 | $setting = new Setting(); |
| 389 | 389 | switch ($settingName) { |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $this->cookie->expects($this->any())->method('getValue')->willReturn(['foo']); |
| 427 | 427 | $this->cache->expects($this->any())->method('contains')->willReturn(true); |
| 428 | 428 | $this->cache->expects($this->any())->method('fetch')->willReturnCallback( |
| 429 | - function ($arg) use ($activeProfilesSetting) { |
|
| 429 | + function($arg) use ($activeProfilesSetting) { |
|
| 430 | 430 | if ($arg == $activeProfilesSetting) { |
| 431 | 431 | return ['foo']; |
| 432 | 432 | } |