@@ -66,7 +66,7 @@ |
||
66 | 66 | //we use the PRE_SUBMIT event to set the mode option |
67 | 67 | $builder->addEventListener( |
68 | 68 | FormEvents::PRE_SUBMIT, |
69 | - function (FormEvent $event) use ($options) { |
|
69 | + function(FormEvent $event) use ($options) { |
|
70 | 70 | //we get the raw data for the widget form |
71 | 71 | $rawData = $event->getData(); |
72 | 72 |
@@ -37,7 +37,6 @@ |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | - * @param array $options |
|
41 | 40 | */ |
42 | 41 | public function add($key, $value) |
43 | 42 | { |
@@ -58,7 +58,7 @@ |
||
58 | 58 | ->getQuery() |
59 | 59 | ->getResult(); |
60 | 60 | $templates = []; |
61 | - $recursiveGetTemplates = function ($template) use (&$recursiveGetTemplates, &$templates) { |
|
61 | + $recursiveGetTemplates = function($template) use (&$recursiveGetTemplates, &$templates) { |
|
62 | 62 | array_push($templates, $template); |
63 | 63 | foreach ($template->getInheritors() as $template) { |
64 | 64 | if ($template instanceof Template) { |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $hash = $this->getHash($widget); |
42 | 42 | if ($hash) { |
43 | 43 | $this->redis->set($hash, $content); |
44 | - $this->redis->expire($hash, 7 * 24 * 60 * 1000); // cache for a week |
|
44 | + $this->redis->expire($hash, 7*24*60*1000); // cache for a week |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 |
@@ -86,6 +86,9 @@ |
||
86 | 86 | ); |
87 | 87 | } |
88 | 88 | |
89 | + /** |
|
90 | + * @param Widget $widget |
|
91 | + */ |
|
89 | 92 | private function generateHash($widget) |
90 | 93 | { |
91 | 94 | return sprintf('%s-%s-%s-%s', |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Predis\Client; |
6 | 6 | use Symfony\Component\Security\Core\Authorization\AuthorizationChecker; |
7 | -use Symfony\Component\Security\Core\SecurityContext; |
|
8 | 7 | use Victoire\Bundle\WidgetBundle\Entity\Widget; |
9 | 8 | use Victoire\Bundle\WidgetBundle\Entity\WidgetSlotInterface; |
10 | 9 |
@@ -24,7 +24,6 @@ |
||
24 | 24 | * WidgetRenderer constructor. |
25 | 25 | * |
26 | 26 | * @param Container $container |
27 | - * @param Client $redis |
|
28 | 27 | * @param WidgetCache $widgetCache |
29 | 28 | */ |
30 | 29 | public function __construct(Container $container, WidgetCache $widgetCache) |
@@ -33,7 +33,7 @@ |
||
33 | 33 | * @param string $view The requested template key |
34 | 34 | * @param array $params The params to give to the template |
35 | 35 | * |
36 | - * @return template |
|
36 | + * @return string |
|
37 | 37 | **/ |
38 | 38 | public function render($view, $params) |
39 | 39 | { |