Completed
Push — master ( 8b424e...491c83 )
by Florian
02:46
created
Form/QueryType.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -37,16 +37,16 @@  discard block
 block discarded – undo
37 37
 		
38 38
 		$usedFacets = $options['used_facets'];
39 39
 		$result = $options['result'];
40
-		if($usedFacets && !$result) {
41
-			foreach($usedFacets as $facetType) {
42
-				$builder->add('facet_' . $facetType, FacetType::class, array(
43
-					'label' => 'stinger_soft_entity_search.forms.query.' . $facetType . '.label',
40
+		if ($usedFacets && !$result) {
41
+			foreach ($usedFacets as $facetType) {
42
+				$builder->add('facet_'.$facetType, FacetType::class, array(
43
+					'label' => 'stinger_soft_entity_search.forms.query.'.$facetType.'.label',
44 44
 					'multiple' => true,
45 45
 					'expanded' => true 
46 46
 				));
47 47
 			}
48 48
 		}
49
-		if($result){
49
+		if ($result) {
50 50
 			$this->createFacets($builder, $result->getFacets());
51 51
 		}
52 52
 		
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
 	 * @param FacetSet $facets        	
80 80
 	 */
81 81
 	protected function createFacets(FormBuilderInterface $builder, FacetSet $facets) {
82
-		foreach($facets->getFacets() as $facetType => $facetValues) {
83
-			$builder->add('facet_' . $facetType, FacetType::class, array(
84
-				'label' => 'stinger_soft_entity_search.forms.query.' . $facetType . '.label',
82
+		foreach ($facets->getFacets() as $facetType => $facetValues) {
83
+			$builder->add('facet_'.$facetType, FacetType::class, array(
84
+				'label' => 'stinger_soft_entity_search.forms.query.'.$facetType.'.label',
85 85
 				'multiple' => true,
86 86
 				'expanded' => true,
87 87
 				'choices' => $this->generateFacetChoices($facetType, $facetValues) 
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
 	protected function generateFacetChoices($facetType, array $facets) {
98 98
 		$choices = array();
99 99
 		
100
-		foreach($facets as $facet => $count) {
101
-			if($count == 0)
100
+		foreach ($facets as $facet => $count) {
101
+			if ($count == 0)
102 102
 				break;
103
-			$choices[$facet . ' (' . $count . ')'] = $facet;
103
+			$choices[$facet.' ('.$count.')'] = $facet;
104 104
 		}
105 105
 		return $choices;
106 106
 	}
Please login to merge, or discard this patch.
Form/FacetType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@
 block discarded – undo
30 30
 		$builder->resetModelTransformers();
31 31
 		$builder->resetViewTransformers();
32 32
 		
33
-		if($options['multiple']) {
34
-			$builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) {
33
+		if ($options['multiple']) {
34
+			$builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) {
35 35
 				$event->stopPropagation();
36 36
 			}, 1);
37 37
 		}
38
-		$builder->addEventListener(FormEvents::SUBMIT, function (FormEvent $event) {
38
+		$builder->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) {
39 39
 			$data = $event->getForm()->getExtraData();
40 40
 			$event->setData(array_unique(array_merge($data, $event->getData())));
41 41
 		});
Please login to merge, or discard this patch.