@@ -38,16 +38,16 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | $usedFacets = $options['used_facets']; |
| 40 | 40 | $result = $options['result']; |
| 41 | - if($usedFacets && !$result) { |
|
| 42 | - foreach($usedFacets as $facetType) { |
|
| 43 | - $builder->add('facet_' . $facetType, FacetType::class, array( |
|
| 44 | - 'label' => 'stinger_soft_entity_search.forms.query.' . $facetType . '.label', |
|
| 41 | + if ($usedFacets && !$result) { |
|
| 42 | + foreach ($usedFacets as $facetType) { |
|
| 43 | + $builder->add('facet_'.$facetType, FacetType::class, array( |
|
| 44 | + 'label' => 'stinger_soft_entity_search.forms.query.'.$facetType.'.label', |
|
| 45 | 45 | 'multiple' => true, |
| 46 | 46 | 'expanded' => true |
| 47 | 47 | )); |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | - if($result){ |
|
| 50 | + if ($result) { |
|
| 51 | 51 | $this->createFacets($builder, $result->getFacets()); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -80,9 +80,9 @@ discard block |
||
| 80 | 80 | * @param FacetSet $facets |
| 81 | 81 | */ |
| 82 | 82 | protected function createFacets(FormBuilderInterface $builder, FacetSet $facets) { |
| 83 | - foreach($facets->getFacets() as $facetType => $facetValues) { |
|
| 84 | - $builder->add('facet_' . $facetType, ChoiceType::class, array( |
|
| 85 | - 'label' => 'stinger_soft_entity_search.forms.query.' . $facetType . '.label', |
|
| 83 | + foreach ($facets->getFacets() as $facetType => $facetValues) { |
|
| 84 | + $builder->add('facet_'.$facetType, ChoiceType::class, array( |
|
| 85 | + 'label' => 'stinger_soft_entity_search.forms.query.'.$facetType.'.label', |
|
| 86 | 86 | 'multiple' => true, |
| 87 | 87 | 'expanded' => true, |
| 88 | 88 | 'choices' => $this->generateFacetChoices($facetType, $facetValues) |
@@ -98,10 +98,10 @@ discard block |
||
| 98 | 98 | protected function generateFacetChoices($facetType, array $facets) { |
| 99 | 99 | $choices = array(); |
| 100 | 100 | |
| 101 | - foreach($facets as $facet => $count) { |
|
| 102 | - if($count == 0) |
|
| 101 | + foreach ($facets as $facet => $count) { |
|
| 102 | + if ($count == 0) |
|
| 103 | 103 | break; |
| 104 | - $choices[$facet . ' (' . $count . ')'] = $facet; |
|
| 104 | + $choices[$facet.' ('.$count.')'] = $facet; |
|
| 105 | 105 | } |
| 106 | 106 | return $choices; |
| 107 | 107 | } |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | $view = $form->createView(); |
| 117 | 117 | $children = $view->children; |
| 118 | 118 | |
| 119 | - foreach(array_keys($formData) as $key) { |
|
| 119 | + foreach (array_keys($formData) as $key) { |
|
| 120 | 120 | $this->assertArrayHasKey($key, $children); |
| 121 | 121 | } |
| 122 | 122 | |