Skip to content

Commit 5817b5b

Browse files
committed
Update php-doc annotations
1 parent acca6a7 commit 5817b5b

File tree

12 files changed

+12
-38
lines changed

12 files changed

+12
-38
lines changed

lib/Elastica/Aggregation/BucketSelector.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ public function __construct(string $name, ?array $bucketsPath = null, ?string $s
2525
/**
2626
* Set the buckets_path for this aggregation.
2727
*
28-
* @param array $bucketsPath
29-
*
3028
* @return $this
3129
*/
32-
public function setBucketsPath($bucketsPath)
30+
public function setBucketsPath(array $bucketsPath): self
3331
{
3432
return $this->setParam('buckets_path', $bucketsPath);
3533
}
@@ -39,7 +37,7 @@ public function setBucketsPath($bucketsPath)
3937
*
4038
* @return $this
4139
*/
42-
public function setGapPolicy(string $gapPolicy = 'skip')
40+
public function setGapPolicy(string $gapPolicy = 'skip'): self
4341
{
4442
return $this->setParam('gap_policy', $gapPolicy);
4543
}

lib/Elastica/Aggregation/Derivative.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(string $name, ?string $bucketsPath = null)
2525
*
2626
* @return $this
2727
*/
28-
public function setBucketsPath(string $bucketsPath)
28+
public function setBucketsPath(string $bucketsPath): self
2929
{
3030
return $this->setParam('buckets_path', $bucketsPath);
3131
}
@@ -35,7 +35,7 @@ public function setBucketsPath(string $bucketsPath)
3535
*
3636
* @return $this
3737
*/
38-
public function setGapPolicy(string $gapPolicy = 'skip')
38+
public function setGapPolicy(string $gapPolicy = 'skip'): self
3939
{
4040
return $this->setParam('gap_policy', $gapPolicy);
4141
}
@@ -45,7 +45,7 @@ public function setGapPolicy(string $gapPolicy = 'skip')
4545
*
4646
* @return $this
4747
*/
48-
public function setFormat(string $format)
48+
public function setFormat(string $format): self
4949
{
5050
return $this->setParam('format', $format);
5151
}

lib/Elastica/Aggregation/Filter.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
*/
1313
class Filter extends AbstractAggregation
1414
{
15-
/**
16-
* @param AbstractQuery $filter
17-
*/
1815
public function __construct(string $name, ?AbstractQuery $filter = null)
1916
{
2017
parent::__construct($name);
@@ -29,7 +26,7 @@ public function __construct(string $name, ?AbstractQuery $filter = null)
2926
*
3027
* @return $this
3128
*/
32-
public function setFilter(AbstractQuery $filter)
29+
public function setFilter(AbstractQuery $filter): self
3330
{
3431
return $this->setParam('filter', $filter);
3532
}

lib/Elastica/Aggregation/Filters.php

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ class Filters extends AbstractAggregation
2525
*
2626
* If a name is given, it will be added as a key, otherwise considered as an anonymous filter
2727
*
28-
* @param string $name
29-
*
3028
* @return $this
3129
*/
3230
public function addFilter(AbstractQuery $filter, ?string $name = null): self

lib/Elastica/Aggregation/Range.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Range extends AbstractSimpleAggregation
2222
*
2323
* @return $this
2424
*/
25-
public function addRange($fromValue = null, $toValue = null, ?string $key = null)
25+
public function addRange($fromValue = null, $toValue = null, ?string $key = null): self
2626
{
2727
if (null === $fromValue && null === $toValue) {
2828
throw new InvalidException('Either fromValue or toValue must be set. Both cannot be null.');
@@ -50,7 +50,7 @@ public function addRange($fromValue = null, $toValue = null, ?string $key = null
5050
*
5151
* @return $this
5252
*/
53-
public function setKeyedResponse(bool $keyed = true)
53+
public function setKeyedResponse(bool $keyed = true): self
5454
{
5555
return $this->setParam('keyed', $keyed);
5656
}

lib/Elastica/Aggregation/ReverseNested.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(string $name, ?string $path = null)
2727
*
2828
* @return $this
2929
*/
30-
public function setPath(string $path)
30+
public function setPath(string $path): self
3131
{
3232
return $this->setParam('path', $path);
3333
}

lib/Elastica/Aggregation/SerialDiff.php

-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ public function setGapPolicy(string $gapPolicy): self
5555
/**
5656
* Set the format for this aggregation.
5757
*
58-
* @param string $format
59-
*
6058
* @return $this
6159
*/
6260
public function setFormat(?string $format = null): self

lib/Elastica/Bulk.php

-7
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ public function getActions(): array
118118
}
119119

120120
/**
121-
* @param string $opType
122-
*
123121
* @return $this
124122
*/
125123
public function addDocument(Document $document, ?string $opType = null): self
@@ -131,7 +129,6 @@ public function addDocument(Document $document, ?string $opType = null): self
131129

132130
/**
133131
* @param Document[] $documents
134-
* @param string $opType
135132
*
136133
* @return $this
137134
*/
@@ -145,8 +142,6 @@ public function addDocuments(array $documents, ?string $opType = null): self
145142
}
146143

147144
/**
148-
* @param string $opType
149-
*
150145
* @return $this
151146
*/
152147
public function addScript(AbstractScript $script, ?string $opType = null): self
@@ -158,7 +153,6 @@ public function addScript(AbstractScript $script, ?string $opType = null): self
158153

159154
/**
160155
* @param Document[] $scripts
161-
* @param string $opType
162156
*
163157
* @return $this
164158
*/
@@ -173,7 +167,6 @@ public function addScripts(array $scripts, $opType = null): self
173167

174168
/**
175169
* @param \Elastica\Script\AbstractScript|\Elastica\Document|array $data
176-
* @param string $opType
177170
*
178171
* @return $this
179172
*/

lib/Elastica/Client.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ class Client
5858
/**
5959
* Creates a new Elastica client.
6060
*
61-
* @param array|string $config OPTIONAL Additional config or DSN of options
62-
* @param callback|null $callback OPTIONAL Callback function which can be used to be notified about errors (for example connection down)
63-
* @param LoggerInterface $logger
61+
* @param array|string $config OPTIONAL Additional config or DSN of options
62+
* @param callback|null $callback OPTIONAL Callback function which can be used to be notified about errors (for example connection down)
6463
*
6564
* @throws \Elastica\Exception\InvalidException
6665
*/

lib/Elastica/Exception/Connection/GuzzleException.php

-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class GuzzleException extends ConnectionException
2020
*/
2121
protected $_guzzleException;
2222

23-
/**
24-
* @param Request $request
25-
*/
2623
public function __construct(TransferException $guzzleException, ?Request $request = null, ?Response $response = null)
2724
{
2825
$this->_guzzleException = $guzzleException;

lib/Elastica/Multi/Search.php

-4
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ class Search
4949

5050
/**
5151
* Constructs search object.
52-
*
53-
* @param MultiBuilderInterface $builder
5452
*/
5553
public function __construct(Client $client, ?MultiBuilderInterface $builder = null)
5654
{
@@ -74,8 +72,6 @@ public function clearSearches(): self
7472
}
7573

7674
/**
77-
* @param string $key
78-
*
7975
* @return $this
8076
*/
8177
public function addSearch(BaseSearch $search, ?string $key = null): self

lib/Elastica/Util.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,9 @@ public static function convertDate($date)
198198
*
199199
* Converts it to the lucene format, including the appropriate TimeZone
200200
*
201-
* @param bool $includeTimezone
202-
*
203201
* @return string
204202
*/
205-
public static function convertDateTimeObject(\DateTime $dateTime, $includeTimezone = true)
203+
public static function convertDateTimeObject(\DateTime $dateTime, bool $includeTimezone = true)
206204
{
207205
$formatString = 'Y-m-d\TH:i:s'.(true === $includeTimezone ? 'P' : '\Z');
208206
$string = $dateTime->format($formatString);

0 commit comments

Comments
 (0)