@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @param ClassMetadataInfo $metadata |
73 | - * @param $configuration |
|
73 | + * @param \Doctrine\ORM\Configuration $configuration |
|
74 | 74 | */ |
75 | 75 | private function setAssociationMappings(ClassMetadataInfo $metadata, $configuration) |
76 | 76 | { |
@@ -153,7 +153,7 @@ |
||
153 | 153 | * Check if a unique constraint has been defined. |
154 | 154 | * |
155 | 155 | * @param ClassMetadata $metadata |
156 | - * @param array $columns |
|
156 | + * @param string[] $columns |
|
157 | 157 | * |
158 | 158 | * @return bool |
159 | 159 | */ |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | return; |
81 | 81 | } |
82 | 82 | |
83 | - $translationResourceMetadata = $this->registry->get($resourceMetadata->getAlias().'_translation'); |
|
83 | + $translationResourceMetadata = $this->registry->get($resourceMetadata->getAlias() . '_translation'); |
|
84 | 84 | |
85 | 85 | $metadata->mapOneToMany([ |
86 | 86 | 'fieldName' => 'translations', |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | if (!$this->hasUniqueConstraint($metadata, $columns)) { |
140 | 140 | $constraints = isset($metadata->table['uniqueConstraints']) ? $metadata->table['uniqueConstraints'] : []; |
141 | 141 | |
142 | - $constraints[$metadata->getTableName().'_uniq_trans'] = [ |
|
142 | + $constraints[$metadata->getTableName() . '_uniq_trans'] = [ |
|
143 | 143 | 'columns' => $columns, |
144 | 144 | ]; |
145 | 145 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * @param mixed $value |
|
43 | + * @param ToggleableInterface $value |
|
44 | 44 | */ |
45 | 45 | private function ensureValueImplementsToggleableInterface($value) |
46 | 46 | { |
@@ -16,8 +16,8 @@ |
||
16 | 16 | use Sylius\Bundle\ReviewBundle\Doctrine\ORM\ReviewRepository; |
17 | 17 | use Sylius\Bundle\ReviewBundle\Form\Type\ReviewType; |
18 | 18 | use Sylius\Component\Resource\Factory\Factory; |
19 | -use Sylius\Component\Review\Model\ReviewerInterface; |
|
20 | 19 | use Sylius\Component\Review\Model\ReviewInterface; |
20 | +use Sylius\Component\Review\Model\ReviewerInterface; |
|
21 | 21 | use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; |
22 | 22 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
23 | 23 | use Symfony\Component\Config\Definition\ConfigurationInterface; |
@@ -75,7 +75,7 @@ |
||
75 | 75 | * @param ReviewInterface $review |
76 | 76 | * @param ReviewableInterface[] $reviewSubjectsToRecalculate |
77 | 77 | * |
78 | - * @return array |
|
78 | + * @return ReviewableInterface[] |
|
79 | 79 | */ |
80 | 80 | private function removeReviewsAndExtractSubject(ReviewInterface $review, array $reviewSubjectsToRecalculate) |
81 | 81 | { |
@@ -14,10 +14,9 @@ |
||
14 | 14 | use Doctrine\Common\Persistence\ObjectManager; |
15 | 15 | use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; |
16 | 16 | use Sylius\Bundle\ReviewBundle\Updater\ReviewableRatingUpdaterInterface; |
17 | -use Sylius\Component\Review\Calculator\ReviewableRatingCalculatorInterface; |
|
17 | +use Sylius\Component\Review\Model\ReviewInterface; |
|
18 | 18 | use Sylius\Component\Review\Model\ReviewableInterface; |
19 | 19 | use Sylius\Component\Review\Model\ReviewerInterface; |
20 | -use Sylius\Component\Review\Model\ReviewInterface; |
|
21 | 20 | |
22 | 21 | /** |
23 | 22 | * @author Grzegorz Sadowski <[email protected]> |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | /** |
192 | 192 | * @param null $facets |
193 | 193 | * @param $configuration |
194 | - * @param $taxon |
|
195 | - * @param null $types |
|
194 | + * @param string $taxon |
|
195 | + * @param string[] $types |
|
196 | 196 | * |
197 | 197 | * @return mixed |
198 | 198 | */ |
@@ -231,11 +231,11 @@ discard block |
||
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
234 | - * @param $searchTerm |
|
234 | + * @param string $searchTerm |
|
235 | 235 | * @param null $appliedFilters |
236 | 236 | * @param $configuration |
237 | - * @param $preSearchTaxonFilter |
|
238 | - * @param $types |
|
237 | + * @param string $preSearchTaxonFilter |
|
238 | + * @param string[] $types |
|
239 | 239 | * |
240 | 240 | * @return mixed |
241 | 241 | */ |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | } |
277 | 277 | |
278 | 278 | /** |
279 | - * @param $elasticaQuery |
|
279 | + * @param Query $elasticaQuery |
|
280 | 280 | * @param null $appliedFilters |
281 | 281 | * @param $configuration |
282 | 282 | * |
@@ -416,10 +416,10 @@ discard block |
||
416 | 416 | /** |
417 | 417 | * @param $facets |
418 | 418 | * @param $appliedFilters |
419 | - * @param $rangeFilters |
|
419 | + * @param BoolOr $rangeFilters |
|
420 | 420 | * @param $termFilters |
421 | 421 | * @param $aggregations |
422 | - * @param $boolFilter |
|
422 | + * @param BoolFilter $boolFilter |
|
423 | 423 | * |
424 | 424 | * @return array |
425 | 425 | */ |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | } |
526 | 526 | |
527 | 527 | /** |
528 | - * @param $filterSetName |
|
528 | + * @param string $filterSetName |
|
529 | 529 | */ |
530 | 530 | private function initializeFacetGroup($filterSetName) |
531 | 531 | { |
@@ -14,25 +14,25 @@ |
||
14 | 14 | use Elastica\Aggregation\Filter; |
15 | 15 | use Elastica\Aggregation\Range as AggregationRange; |
16 | 16 | use Elastica\Aggregation\Terms as AggregationTerms; |
17 | -use Elastica\Query; |
|
18 | -use Elastica\Query\BoolQuery; |
|
19 | -use Elastica\Query\Filtered; |
|
20 | -use Elastica\Query\QueryString; |
|
21 | -use Elastica\Query\Range as QueryRange; |
|
22 | -use Elastica\Query\Term as QueryTerm; |
|
23 | 17 | use Elastica\Filter\BoolFilter; |
24 | 18 | use Elastica\Filter\BoolOr; |
25 | 19 | use Elastica\Filter\Missing; |
26 | 20 | use Elastica\Filter\Nested; |
27 | 21 | use Elastica\Filter\Range as FilterRange; |
28 | -use Elastica\Filter\Type; |
|
29 | 22 | use Elastica\Filter\Term as FilterTerm; |
30 | 23 | use Elastica\Filter\Terms as FilterTerms; |
24 | +use Elastica\Filter\Type; |
|
25 | +use Elastica\Query; |
|
26 | +use Elastica\Query\BoolQuery; |
|
27 | +use Elastica\Query\Filtered; |
|
28 | +use Elastica\Query\QueryString; |
|
29 | +use Elastica\Query\Range as QueryRange; |
|
30 | +use Elastica\Query\Term as QueryTerm; |
|
31 | 31 | use Sylius\Bundle\SearchBundle\Doctrine\ORM\SearchIndexRepository; |
32 | +use Sylius\Bundle\SearchBundle\QueryLogger\QueryLoggerInterface; |
|
32 | 33 | use Sylius\Bundle\SearchBundle\Query\Query as SyliusSearchQuery; |
33 | 34 | use Sylius\Bundle\SearchBundle\Query\SearchStringQuery; |
34 | 35 | use Sylius\Bundle\SearchBundle\Query\TaxonQuery; |
35 | -use Sylius\Bundle\SearchBundle\QueryLogger\QueryLoggerInterface; |
|
36 | 36 | use Sylius\Component\Channel\Context\ChannelContextInterface; |
37 | 37 | |
38 | 38 | /** |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | } |
331 | 331 | |
332 | 332 | foreach ($facets as &$facet) { |
333 | - $facet = array_filter($facet, function($v){ |
|
333 | + $facet = array_filter($facet, function ($v) { |
|
334 | 334 | return $v["doc_count"] != 0; |
335 | 335 | }); |
336 | 336 | } |
@@ -385,29 +385,29 @@ discard block |
||
385 | 385 | foreach ($configuration['filters']['facets'] as $name => $facet) { |
386 | 386 | // terms facet creation |
387 | 387 | if ($facet['type'] === 'terms') { |
388 | - ${$name.'AggregationFilter'} = new Filter($name); |
|
388 | + ${$name . 'AggregationFilter'} = new Filter($name); |
|
389 | 389 | |
390 | - ${$name.'Aggregation'} = new AggregationTerms($name); |
|
391 | - ${$name.'Aggregation'}->setField($name); |
|
392 | - ${$name.'Aggregation'}->setSize(550); |
|
390 | + ${$name . 'Aggregation'} = new AggregationTerms($name); |
|
391 | + ${$name . 'Aggregation'}->setField($name); |
|
392 | + ${$name . 'Aggregation'}->setSize(550); |
|
393 | 393 | |
394 | - ${$name.'AggregationFilter'}->addAggregation(${$name.'Aggregation'}); |
|
394 | + ${$name . 'AggregationFilter'}->addAggregation(${$name . 'Aggregation'}); |
|
395 | 395 | } // range facet creation |
396 | 396 | elseif ('range' === $facet['type']) { |
397 | - ${$name.'AggregationFilter'} = new Filter($name); |
|
397 | + ${$name . 'AggregationFilter'} = new Filter($name); |
|
398 | 398 | |
399 | - ${$name.'Aggregation'} = new AggregationRange($name); |
|
399 | + ${$name . 'Aggregation'} = new AggregationRange($name); |
|
400 | 400 | foreach ($facet['values'] as $value) { |
401 | - ${$name.'Aggregation'} |
|
401 | + ${$name . 'Aggregation'} |
|
402 | 402 | ->setField($name) |
403 | 403 | ->addRange($value['from'], $value['to']); |
404 | 404 | } |
405 | 405 | |
406 | - ${$name.'AggregationFilter'}->addAggregation(${$name.'Aggregation'}); |
|
406 | + ${$name . 'AggregationFilter'}->addAggregation(${$name . 'Aggregation'}); |
|
407 | 407 | } |
408 | 408 | |
409 | - $aggregations[$name]['aggregation'] = ${$name.'Aggregation'}; |
|
410 | - $aggregations[$name]['aggregation_filter'] = ${$name.'AggregationFilter'}; |
|
409 | + $aggregations[$name]['aggregation'] = ${$name . 'Aggregation'}; |
|
410 | + $aggregations[$name]['aggregation_filter'] = ${$name . 'AggregationFilter'}; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | return $aggregations; |
@@ -428,20 +428,20 @@ discard block |
||
428 | 428 | foreach ($facets as $name => $facet) { |
429 | 429 | $normName = key($facet); |
430 | 430 | |
431 | - ${$normName.'BoolFilter'} = new BoolFilter(); |
|
431 | + ${$normName . 'BoolFilter'} = new BoolFilter(); |
|
432 | 432 | |
433 | 433 | foreach ($appliedFilters as $value) { |
434 | 434 | if (is_array($value[key($value)])) { |
435 | - ${$normName.'RangeFilter'} = new FilterRange(); |
|
435 | + ${$normName . 'RangeFilter'} = new FilterRange(); |
|
436 | 436 | |
437 | 437 | foreach ($value as $range) { |
438 | - ${$normName.'RangeFilter'}->addField($name, ['gte' => $range['range'][0], 'lte' => $range['range'][1]]); |
|
439 | - ${$normName.'BoolFilter'}->addMust($rangeFilters); |
|
438 | + ${$normName . 'RangeFilter'}->addField($name, ['gte' => $range['range'][0], 'lte' => $range['range'][1]]); |
|
439 | + ${$normName . 'BoolFilter'}->addMust($rangeFilters); |
|
440 | 440 | } |
441 | 441 | } else { |
442 | - ${$normName.'TermFilter'} = new FilterTerm(); |
|
443 | - ${$normName.'TermFilter'}->setTerm($name, $value[key($value)]); |
|
444 | - ${$normName.'BoolFilter'}->addMust($termFilters); |
|
442 | + ${$normName . 'TermFilter'} = new FilterTerm(); |
|
443 | + ${$normName . 'TermFilter'}->setTerm($name, $value[key($value)]); |
|
444 | + ${$normName . 'BoolFilter'}->addMust($termFilters); |
|
445 | 445 | } |
446 | 446 | } |
447 | 447 | } |
@@ -451,8 +451,8 @@ discard block |
||
451 | 451 | if (count($facets) >= count($this->config['filters']['facets'])) { |
452 | 452 | $aggregations[$name]['aggregation_filter']->setFilter($boolFilter); |
453 | 453 | } elseif ($name != key($value)) { |
454 | - if (isset(${key($value).'BoolFilter'})) { |
|
455 | - $aggregations[$name]['aggregation_filter']->setFilter(${key($value).'BoolFilter'}); |
|
454 | + if (isset(${key($value) . 'BoolFilter'})) { |
|
455 | + $aggregations[$name]['aggregation_filter']->setFilter(${key($value) . 'BoolFilter'}); |
|
456 | 456 | } |
457 | 457 | } |
458 | 458 | } |
@@ -330,7 +330,7 @@ |
||
330 | 330 | } |
331 | 331 | |
332 | 332 | foreach ($facets as &$facet) { |
333 | - $facet = array_filter($facet, function($v){ |
|
333 | + $facet = array_filter($facet, function($v) { |
|
334 | 334 | return $v["doc_count"] != 0; |
335 | 335 | }); |
336 | 336 | } |
@@ -421,7 +421,7 @@ |
||
421 | 421 | /** |
422 | 422 | * This functions unsets the configured filters based on the facet groups |
423 | 423 | * |
424 | - * @param $filterSetName |
|
424 | + * @param string $filterSetName |
|
425 | 425 | */ |
426 | 426 | private function initializeFacetGroup($filterSetName) |
427 | 427 | { |
@@ -16,10 +16,10 @@ |
||
16 | 16 | use Pagerfanta\Pagerfanta; |
17 | 17 | use Sylius\Bundle\SearchBundle\Doctrine\ORM\SearchIndexRepository; |
18 | 18 | use Sylius\Bundle\SearchBundle\Model\SearchIndex; |
19 | +use Sylius\Bundle\SearchBundle\QueryLogger\QueryLoggerInterface; |
|
19 | 20 | use Sylius\Bundle\SearchBundle\Query\Query; |
20 | 21 | use Sylius\Bundle\SearchBundle\Query\SearchStringQuery; |
21 | 22 | use Sylius\Bundle\SearchBundle\Query\TaxonQuery; |
22 | -use Sylius\Bundle\SearchBundle\QueryLogger\QueryLoggerInterface; |
|
23 | 23 | use Sylius\Component\Channel\Context\ChannelContextInterface; |
24 | 24 | |
25 | 25 | /** |
@@ -73,7 +73,7 @@ |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
76 | - * @param $message |
|
76 | + * @param string $message |
|
77 | 77 | */ |
78 | 78 | private function addToOutput($message) |
79 | 79 | { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | private function addToOutput($message) |
79 | 79 | { |
80 | - $this->output .= $message.PHP_EOL; |
|
80 | + $this->output .= $message . PHP_EOL; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | $fieldNames = array_keys($fields); |
124 | 124 | foreach ($fieldNames as &$value) { |
125 | - $value = 'u.'.$value; |
|
125 | + $value = 'u.' . $value; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | $this->addToOutput(sprintf('Populating index table with "%s" data', $entity)); |
@@ -241,10 +241,10 @@ discard block |
||
241 | 241 | // TODO maybe I can use the property accessor here |
242 | 242 | $content = ''; |
243 | 243 | foreach (array_keys(array_slice($fields, 1)) as $field) { |
244 | - $func = 'get'.ucfirst($field); |
|
244 | + $func = 'get' . ucfirst($field); |
|
245 | 245 | |
246 | 246 | if (method_exists($element, $func)) { |
247 | - $content .= $element->$func().self::SPACER; |
|
247 | + $content .= $element->$func() . self::SPACER; |
|
248 | 248 | } |
249 | 249 | } |
250 | 250 |
@@ -14,9 +14,9 @@ |
||
14 | 14 | use Doctrine\Common\EventSubscriber; |
15 | 15 | use Doctrine\ORM\Event\LifecycleEventArgs; |
16 | 16 | use FOS\ElasticaBundle\Persister\ObjectPersister; |
17 | +use Sylius\Component\Core\Model\ProductTranslation; |
|
17 | 18 | use Sylius\Component\Product\Model\AttributeValueInterface; |
18 | 19 | use Sylius\Component\Product\Model\ProductInterface; |
19 | -use Sylius\Component\Core\Model\ProductTranslation; |
|
20 | 20 | use Sylius\Component\Variation\Model\VariantInterface; |
21 | 21 | |
22 | 22 | /** |
@@ -58,7 +58,7 @@ |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
61 | - * @return array |
|
61 | + * @return string[] |
|
62 | 62 | */ |
63 | 63 | public function getRecipients() |
64 | 64 | { |