Skip to content

Commit

Permalink
Update php-doc annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
deguif committed Nov 18, 2019
1 parent acca6a7 commit 5817b5b
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 38 deletions.
6 changes: 2 additions & 4 deletions lib/Elastica/Aggregation/BucketSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ public function __construct(string $name, ?array $bucketsPath = null, ?string $s
/**
* Set the buckets_path for this aggregation.
*
* @param array $bucketsPath
*
* @return $this
*/
public function setBucketsPath($bucketsPath)
public function setBucketsPath(array $bucketsPath): self
{
return $this->setParam('buckets_path', $bucketsPath);
}
Expand All @@ -39,7 +37,7 @@ public function setBucketsPath($bucketsPath)
*
* @return $this
*/
public function setGapPolicy(string $gapPolicy = 'skip')
public function setGapPolicy(string $gapPolicy = 'skip'): self
{
return $this->setParam('gap_policy', $gapPolicy);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Elastica/Aggregation/Derivative.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(string $name, ?string $bucketsPath = null)
*
* @return $this
*/
public function setBucketsPath(string $bucketsPath)
public function setBucketsPath(string $bucketsPath): self
{
return $this->setParam('buckets_path', $bucketsPath);
}
Expand All @@ -35,7 +35,7 @@ public function setBucketsPath(string $bucketsPath)
*
* @return $this
*/
public function setGapPolicy(string $gapPolicy = 'skip')
public function setGapPolicy(string $gapPolicy = 'skip'): self
{
return $this->setParam('gap_policy', $gapPolicy);
}
Expand All @@ -45,7 +45,7 @@ public function setGapPolicy(string $gapPolicy = 'skip')
*
* @return $this
*/
public function setFormat(string $format)
public function setFormat(string $format): self
{
return $this->setParam('format', $format);
}
Expand Down
5 changes: 1 addition & 4 deletions lib/Elastica/Aggregation/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
*/
class Filter extends AbstractAggregation
{
/**
* @param AbstractQuery $filter
*/
public function __construct(string $name, ?AbstractQuery $filter = null)
{
parent::__construct($name);
Expand All @@ -29,7 +26,7 @@ public function __construct(string $name, ?AbstractQuery $filter = null)
*
* @return $this
*/
public function setFilter(AbstractQuery $filter)
public function setFilter(AbstractQuery $filter): self
{
return $this->setParam('filter', $filter);
}
Expand Down
2 changes: 0 additions & 2 deletions lib/Elastica/Aggregation/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class Filters extends AbstractAggregation
*
* If a name is given, it will be added as a key, otherwise considered as an anonymous filter
*
* @param string $name
*
* @return $this
*/
public function addFilter(AbstractQuery $filter, ?string $name = null): self
Expand Down
4 changes: 2 additions & 2 deletions lib/Elastica/Aggregation/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Range extends AbstractSimpleAggregation
*
* @return $this
*/
public function addRange($fromValue = null, $toValue = null, ?string $key = null)
public function addRange($fromValue = null, $toValue = null, ?string $key = null): self
{
if (null === $fromValue && null === $toValue) {
throw new InvalidException('Either fromValue or toValue must be set. Both cannot be null.');
Expand Down Expand Up @@ -50,7 +50,7 @@ public function addRange($fromValue = null, $toValue = null, ?string $key = null
*
* @return $this
*/
public function setKeyedResponse(bool $keyed = true)
public function setKeyedResponse(bool $keyed = true): self
{
return $this->setParam('keyed', $keyed);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Aggregation/ReverseNested.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(string $name, ?string $path = null)
*
* @return $this
*/
public function setPath(string $path)
public function setPath(string $path): self
{
return $this->setParam('path', $path);
}
Expand Down
2 changes: 0 additions & 2 deletions lib/Elastica/Aggregation/SerialDiff.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public function setGapPolicy(string $gapPolicy): self
/**
* Set the format for this aggregation.
*
* @param string $format
*
* @return $this
*/
public function setFormat(?string $format = null): self
Expand Down
7 changes: 0 additions & 7 deletions lib/Elastica/Bulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ public function getActions(): array
}

/**
* @param string $opType
*
* @return $this
*/
public function addDocument(Document $document, ?string $opType = null): self
Expand All @@ -131,7 +129,6 @@ public function addDocument(Document $document, ?string $opType = null): self

/**
* @param Document[] $documents
* @param string $opType
*
* @return $this
*/
Expand All @@ -145,8 +142,6 @@ public function addDocuments(array $documents, ?string $opType = null): self
}

/**
* @param string $opType
*
* @return $this
*/
public function addScript(AbstractScript $script, ?string $opType = null): self
Expand All @@ -158,7 +153,6 @@ public function addScript(AbstractScript $script, ?string $opType = null): self

/**
* @param Document[] $scripts
* @param string $opType
*
* @return $this
*/
Expand All @@ -173,7 +167,6 @@ public function addScripts(array $scripts, $opType = null): self

/**
* @param \Elastica\Script\AbstractScript|\Elastica\Document|array $data
* @param string $opType
*
* @return $this
*/
Expand Down
5 changes: 2 additions & 3 deletions lib/Elastica/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ class Client
/**
* Creates a new Elastica client.
*
* @param array|string $config OPTIONAL Additional config or DSN of options
* @param callback|null $callback OPTIONAL Callback function which can be used to be notified about errors (for example connection down)
* @param LoggerInterface $logger
* @param array|string $config OPTIONAL Additional config or DSN of options
* @param callback|null $callback OPTIONAL Callback function which can be used to be notified about errors (for example connection down)
*
* @throws \Elastica\Exception\InvalidException
*/
Expand Down
3 changes: 0 additions & 3 deletions lib/Elastica/Exception/Connection/GuzzleException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class GuzzleException extends ConnectionException
*/
protected $_guzzleException;

/**
* @param Request $request
*/
public function __construct(TransferException $guzzleException, ?Request $request = null, ?Response $response = null)
{
$this->_guzzleException = $guzzleException;
Expand Down
4 changes: 0 additions & 4 deletions lib/Elastica/Multi/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class Search

/**
* Constructs search object.
*
* @param MultiBuilderInterface $builder
*/
public function __construct(Client $client, ?MultiBuilderInterface $builder = null)
{
Expand All @@ -74,8 +72,6 @@ public function clearSearches(): self
}

/**
* @param string $key
*
* @return $this
*/
public function addSearch(BaseSearch $search, ?string $key = null): self
Expand Down
4 changes: 1 addition & 3 deletions lib/Elastica/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,9 @@ public static function convertDate($date)
*
* Converts it to the lucene format, including the appropriate TimeZone
*
* @param bool $includeTimezone
*
* @return string
*/
public static function convertDateTimeObject(\DateTime $dateTime, $includeTimezone = true)
public static function convertDateTimeObject(\DateTime $dateTime, bool $includeTimezone = true)
{
$formatString = 'Y-m-d\TH:i:s'.(true === $includeTimezone ? 'P' : '\Z');
$string = $dateTime->format($formatString);
Expand Down

0 comments on commit 5817b5b

Please sign in to comment.