Skip to content

Commit fc9dc43

Browse files
committed
Added ExponentialBackoffExceptionHandler::DEFAULT_COEFFICIENT.
1 parent 527eff2 commit fc9dc43

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

.travis.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,28 @@ php:
1010
- 5.6
1111
- 7.0
1212
- 7.1
13+
- 7.2
14+
15+
env:
16+
matrix:
17+
-
18+
- DEPENDENCIES=--prefer-lowest
19+
20+
matrix:
21+
fast_finish: true
22+
23+
cache:
24+
directories:
25+
- vendor
1326

1427
install:
1528
- alias composer=composer\ -n && composer selfupdate
1629
- composer validate
17-
- composer --prefer-source install
30+
- composer update --no-progress --no-suggest $DEPENDENCIES
1831

1932
script:
20-
- bin/test --coverage-clover=build/logs/clover.xml
33+
- composer test -- --coverage-clover=build/logs/clover.xml
2134

2235
after_success:
23-
- composer --prefer-source require satooshi/php-coveralls
24-
- vendor/bin/coveralls -v
36+
- composer require php-coveralls/php-coveralls:^2
37+
- vendor/bin/php-coveralls -v

bin/test

-5
This file was deleted.

composer.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"scriptfusion/retry": "^1"
1212
},
1313
"require-dev": {
14-
"phpunit/phpunit": "^4"
14+
"phpunit/phpunit": "^4.8"
1515
},
1616
"autoload": {
1717
"psr-4": {
@@ -22,5 +22,8 @@
2222
"psr-4": {
2323
"ScriptFUSIONTest\\Retry\\ExceptionHandler\\": "test"
2424
}
25+
},
26+
"scripts": {
27+
"test": "phpunit -c test"
2528
}
2629
}

src/ExponentialBackoffExceptionHandler.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
*/
99
class ExponentialBackoffExceptionHandler extends MicroSleepExceptionHandler
1010
{
11+
const DEFAULT_COEFFICIENT = 102000;
12+
1113
private $microTimeCoefficient;
1214

13-
public function __construct($microTimeCoefficient = 102000)
15+
public function __construct($microTimeCoefficient = self::DEFAULT_COEFFICIENT)
1416
{
1517
parent::__construct($this->generateSequence(
1618
$this->microTimeCoefficient = $microTimeCoefficient|0

0 commit comments

Comments
 (0)