From 31a93297b211b7d31c360b224f6c4133872a8699 Mon Sep 17 00:00:00 2001 From: Martynas Sudintas <martynas.sudintas@nfq.lt> Date: Mon, 19 Jan 2015 10:30:29 +0200 Subject: [PATCH] ONGR strict psr fixes --- Aggregation/TopHitsAggregation.php | 12 +++------ Filter/AbstractFilter.php | 4 +-- Filter/IndicesFilter.php | 4 +-- Highlight/Field.php | 36 ++++++++------------------- Highlight/Highlight.php | 28 ++++++--------------- Query/FilteredQuery.php | 2 +- Query/IndicesQuery.php | 4 +-- Query/Query.php | 2 +- Query/RangeQuery.php | 4 +-- Search.php | 8 +++--- Sort/GeoSort.php | 4 +-- Sort/ScriptSort.php | 8 ++---- Sort/Sort.php | 4 +-- Sort/Sorts.php | 4 +-- Suggester/Completion.php | 2 +- Suggester/Context.php | 6 ++--- Suggester/Context/AbstractContext.php | 8 ++---- Suggester/Phrase.php | 2 +- 18 files changed, 44 insertions(+), 98 deletions(-) diff --git a/Aggregation/TopHitsAggregation.php b/Aggregation/TopHitsAggregation.php index 79a55ef..0dc099e 100644 --- a/Aggregation/TopHitsAggregation.php +++ b/Aggregation/TopHitsAggregation.php @@ -22,23 +22,17 @@ class TopHitsAggregation extends AbstractAggregation use MetricTrait; /** - * Number of top matching hits to return per bucket. - * - * @var int + * @var int Number of top matching hits to return per bucket. */ private $size; /** - * The offset from the first result you want to fetch. - * - * @var int + * @var int The offset from the first result you want to fetch. */ private $from; /** - * How the top matching hits should be sorted. - * - * @var Sorts + * @var Sorts How the top matching hits should be sorted. */ private $sort; diff --git a/Filter/AbstractFilter.php b/Filter/AbstractFilter.php index 662f851..bf5d837 100644 --- a/Filter/AbstractFilter.php +++ b/Filter/AbstractFilter.php @@ -25,9 +25,9 @@ abstract class AbstractFilter protected $filters; /** - * @param array $boolParams Bool parameters. + * Initializes bool filter. * - * @internal param bool $filters Filters collection. + * @param array $boolParams Bool parameters. */ public function __construct($boolParams = []) { diff --git a/Filter/IndicesFilter.php b/Filter/IndicesFilter.php index a9c92db..8e17a9c 100644 --- a/Filter/IndicesFilter.php +++ b/Filter/IndicesFilter.php @@ -19,12 +19,12 @@ use ONGR\ElasticsearchBundle\DSL\BuilderInterface; class IndicesFilter implements BuilderInterface { /** - * @var string[] $indices + * @var string[] */ private $indices; /** - * @var BuilderInterface $filter + * @var BuilderInterface */ private $filter; diff --git a/Highlight/Field.php b/Highlight/Field.php index de6360d..51f9f47 100644 --- a/Highlight/Field.php +++ b/Highlight/Field.php @@ -23,63 +23,49 @@ class Field const TYPE_FVH = 'fvh'; /** - * Field name. - * - * @var string + * @var string Field name. */ protected $name; /** - * Highlighter type. By default 'plain'. - * - * @var string + * @var string Highlighter type. By default 'plain'. */ protected $type; /** - * Size of the highlighted fragment in characters. By default 100. - * - * @var int + * @var int Size of the highlighted fragment in characters. By default 100. */ protected $fragmentSize; /** - * Maximum number of fragments to return. By default 5. - * - * @var int + * @var int Maximum number of fragments to return. By default 5. */ protected $numberOfFragments; /** - * Combine matches on multiple fields to highlight a single field. - * - * @var array + * @var array Combine matches on multiple fields to highlight a single field. */ protected $matchedFields; /** - * Query to highlight. - * - * @var BuilderInterface + * @var BuilderInterface Query to highlight. */ protected $highlightQuery; /** - * Show part of string even if there are no matches to highlight. Defaults to 0. - * - * @var int + * @var int Show part of string even if there are no matches to highlight. Defaults to 0. */ protected $noMatchSize; /** - * Highlight fields based on the source. - * - * @var bool + * @var bool Highlight fields based on the source. */ protected $forceSource; /** - * @param string $name + * Creates a highlight for a field. + * + * @param string $name Field name. */ public function __construct($name) { diff --git a/Highlight/Highlight.php b/Highlight/Highlight.php index 683ffcc..ba28361 100644 --- a/Highlight/Highlight.php +++ b/Highlight/Highlight.php @@ -21,51 +21,37 @@ class Highlight const TYPE_FVH = 'fvh'; /** - * Holds fields to highlight. - * - * @var array + * @var array Holds fields to highlight. */ protected $fields = []; /** - * Holds html tag name and class that highlight will be put in (default 'em' tag). - * - * @var array + * @var array Holds html tag name and class that highlight will be put in (default 'em' tag). */ protected $tags = []; /** - * Holds tag schema name. 'styled' is the only option yet. - * - * @var string + * @var string Holds tag schema name. 'styled' is the only option yet. */ protected $tagsSchema = null; /** - * Fragments sort type. - * - * @var string + * @var string Fragments sort type. */ protected $order = null; /** - * Highlighter type. By default plain. - * - * @var string + * @var string Highlighter type. By default plain. */ protected $type = null; /** - * Size of the highlighted fragment in characters. By default 100. - * - * @var int + * @var int Size of the highlighted fragment in characters. By default 100. */ protected $fragmentSize = null; /** - * Maximum number of fragments to return. By default 5. - * - * @var int + * @var int Maximum number of fragments to return. By default 5. */ protected $numberOfFragments = null; diff --git a/Query/FilteredQuery.php b/Query/FilteredQuery.php index b32b96a..e216d26 100644 --- a/Query/FilteredQuery.php +++ b/Query/FilteredQuery.php @@ -20,7 +20,7 @@ use ONGR\ElasticsearchBundle\DSL\Filter\AbstractFilter; class FilteredQuery extends AbstractFilter implements BuilderInterface { /** - * @var Query used inside filtered area. + * @var Query Used inside filtered area. */ private $query; diff --git a/Query/IndicesQuery.php b/Query/IndicesQuery.php index ac99ae2..7b33ab3 100644 --- a/Query/IndicesQuery.php +++ b/Query/IndicesQuery.php @@ -19,12 +19,12 @@ use ONGR\ElasticsearchBundle\DSL\BuilderInterface; class IndicesQuery implements BuilderInterface { /** - * @var string[] $indices + * @var string[] */ private $indices; /** - * @var BuilderInterface $query + * @var BuilderInterface */ private $query; diff --git a/Query/Query.php b/Query/Query.php index 26f07b6..8248116 100644 --- a/Query/Query.php +++ b/Query/Query.php @@ -20,7 +20,7 @@ use ONGR\ElasticsearchBundle\DSL\BuilderInterface; class Query implements BuilderInterface { /** - * @var BuilderInterface[] Queries + * @var BuilderInterface[] */ private $queries; diff --git a/Query/RangeQuery.php b/Query/RangeQuery.php index 6d06c81..939212a 100644 --- a/Query/RangeQuery.php +++ b/Query/RangeQuery.php @@ -30,9 +30,7 @@ class RangeQuery implements BuilderInterface const GTE = 'gte'; /** - * Field name. - * - * @var string + * @var string Field name. */ private $field; diff --git a/Search.php b/Search.php index ee7140b..94316a4 100644 --- a/Search.php +++ b/Search.php @@ -31,7 +31,7 @@ class Search const SCROLL_DURATION = '5m'; /** - * @var Query $query + * @var Query */ private $query; @@ -41,14 +41,12 @@ class Search private $boolQueryParams; /** - * @var BuilderInterface $filters + * @var BuilderInterface */ private $filters; /** - * Filters collection. - * - * @var BuilderInterface $postFilters + * @var BuilderInterface Filters collection. */ private $postFilters; diff --git a/Sort/GeoSort.php b/Sort/GeoSort.php index 1264ed9..068de8c 100644 --- a/Sort/GeoSort.php +++ b/Sort/GeoSort.php @@ -29,9 +29,7 @@ class GeoSort extends AbstractSort protected $location; /** - * Units in which to measure distance. - * - * @var string + * @var string Units in which to measure distance. */ protected $unit; diff --git a/Sort/ScriptSort.php b/Sort/ScriptSort.php index 29e4cfd..9611805 100644 --- a/Sort/ScriptSort.php +++ b/Sort/ScriptSort.php @@ -20,16 +20,12 @@ namespace ONGR\ElasticsearchBundle\DSL\Sort; class ScriptSort extends AbstractSort { /** - * Script to execute. - * - * @var string + * @var string Script to execute. */ private $script; /** - * Type returned (number, string). - * - * @var string + * @var string Type returned (number, string). */ private $returnType; diff --git a/Sort/Sort.php b/Sort/Sort.php index b85770f..04be3b2 100644 --- a/Sort/Sort.php +++ b/Sort/Sort.php @@ -19,9 +19,7 @@ use ONGR\ElasticsearchBundle\DSL\BuilderInterface; class Sort extends AbstractSort { /** - * Filter for sorting. - * - * @var BuilderInterface + * @var BuilderInterface Filter for sorting. */ private $nestedFilter; diff --git a/Sort/Sorts.php b/Sort/Sorts.php index 5261619..f4bc32d 100644 --- a/Sort/Sorts.php +++ b/Sort/Sorts.php @@ -19,9 +19,7 @@ use ONGR\ElasticsearchBundle\DSL\BuilderInterface; class Sorts implements BuilderInterface { /** - * Sorts collection. - * - * @var AbstractSort[] + * @var AbstractSort[] Sorts collection. */ private $sorts = []; diff --git a/Suggester/Completion.php b/Suggester/Completion.php index 767d6bb..bd045e2 100644 --- a/Suggester/Completion.php +++ b/Suggester/Completion.php @@ -87,7 +87,7 @@ class Completion extends AbstractSuggester $this->getName() => [ 'text' => $this->getText(), 'completion' => $completion, - ] + ], ]; } diff --git a/Suggester/Context.php b/Suggester/Context.php index 06c1610..af7ac4b 100644 --- a/Suggester/Context.php +++ b/Suggester/Context.php @@ -24,9 +24,7 @@ class Context extends AbstractSuggester private $context; /** - * Size of completion. - * - * @var int + * @var int Size of completion. */ private $size; @@ -93,7 +91,7 @@ class Context extends AbstractSuggester $this->getName() => [ 'text' => $this->getText(), 'completion' => $completion, - ] + ], ]; } diff --git a/Suggester/Context/AbstractContext.php b/Suggester/Context/AbstractContext.php index f9f0a72..7dc69da 100644 --- a/Suggester/Context/AbstractContext.php +++ b/Suggester/Context/AbstractContext.php @@ -17,16 +17,12 @@ namespace ONGR\ElasticsearchBundle\DSL\Suggester\Context; abstract class AbstractContext { /** - * Name of the context used. - * - * @var string + * @var string Name of the context used. */ private $name; /** - * Value of the context. - * - * @var string|array + * @var string|array Value of the context. */ private $value; diff --git a/Suggester/Phrase.php b/Suggester/Phrase.php index 7c2adb9..95b182e 100644 --- a/Suggester/Phrase.php +++ b/Suggester/Phrase.php @@ -85,7 +85,7 @@ class Phrase extends AbstractSuggester $this->getName() => [ 'text' => $this->getText(), 'phrase' => array_filter($phrase), - ] + ], ]; } -- GitLab