Skip to content

Commit

Permalink
Fix PHPStan complains
Browse files Browse the repository at this point in the history
  • Loading branch information
yriveiro committed Jan 13, 2018
1 parent b37a6d7 commit 1077f6a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"email": "yago.riveiro@gmail.com"
}],
"require": {
"php": ">=7.0"
"php": ">=7.0",
"phpstan/phpstan": "^0.9.1"
},
"require-dev": {
"phpunit/phpunit": "~6.2",
Expand All @@ -27,4 +28,3 @@
}
}
}

12 changes: 7 additions & 5 deletions src/Backoff.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public function __construct($options = [])
/**
* Returns an array of Configuration.
*
* cap: Max duration allowed (in microseconds). If backoff duration
* is greater than cap, cap is returned.
* cap: Max duration allowed (in microseconds). If backoff duration
* is greater than cap, cap is returned.
* maxAttempts: Number of attemps before thrown an Yriveiro\Backoff\BackoffException.
*
* @return mixed
* @return array
*/
public static function getDefaultOptions() : array
{
Expand All @@ -46,9 +46,11 @@ public static function getDefaultOptions() : array
/**
* Allows overwrite default option values.
*
* @param mixed
* @param array $options Configuration options.
*
* @return BackoffInterface
*/
public function setOptions($options)
public function setOptions($options) : BackoffInterface
{
if (!is_array($options)) {
$options = [$options];
Expand Down
2 changes: 2 additions & 0 deletions tests/BackoffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

class BackoffTest extends TestCase
{
protected $backoff;

public function setUp()
{
$this->backoff = new Backoff();
Expand Down

0 comments on commit 1077f6a

Please sign in to comment.