Skip to content

Commit eee7ea0

Browse files
committed
Merge pull request #12 from clue/rename
Rename to promise-timer
2 parents b0fe41b + 25184ac commit eee7ea0

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# clue/promise-timeout [![Build Status](https://travis-ci.org/clue/php-promise-timeout.svg?branch=master)](https://travis-ci.org/clue/php-promise-timeout)
1+
# clue/promise-timer [![Build Status](https://travis-ci.org/clue/php-promise-timer.svg?branch=master)](https://travis-ci.org/clue/php-promise-timer)
22

33
A trivial implementation of timeouts for `Promise`s, built on top of [React PHP](http://reactphp.org/).
44

@@ -11,7 +11,7 @@ The recommended way to install this library is [through composer](http://getcomp
1111
```JSON
1212
{
1313
"require": {
14-
"clue/promise-timeout": "dev-master"
14+
"clue/promise-timer": "dev-master"
1515
}
1616
}
1717
```

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "clue/promise-timeout",
2+
"name": "clue/promise-timer",
33
"description": "Trivial timeout implementation for Promises",
4-
"keywords": ["Promise", "timeout", "event-loop", "ReactPHP", "async"],
5-
"homepage": "https://github.com/clue/php-promise-timeout",
4+
"keywords": ["Promise", "timeout", "timer", "event-loop", "ReactPHP", "async"],
5+
"homepage": "https://github.com/clue/php-promise-timer",
66
"license": "MIT",
77
"authors": [
88
{
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"autoload": {
14-
"psr-4": { "Clue\\Promise\\Timeout\\": "src/" },
14+
"psr-4": { "Clue\\Promise\\Timer\\": "src/" },
1515
"files": [ "src/functions.php" ]
1616
},
1717
"require": {

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
convertWarningsToExceptions="true"
88
>
99
<testsuites>
10-
<testsuite name="Promise Timeout Test Suite">
10+
<testsuite name="Promise Timer Test Suite">
1111
<directory>./tests/</directory>
1212
</testsuite>
1313
</testsuites>

src/TimeoutException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Clue\Promise\Timeout;
3+
namespace Clue\Promise\Timer;
44

55
use RuntimeException;
66

src/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Clue\Promise\Timeout;
3+
namespace Clue\Promise\Timer;
44

55
use React\Promise\CancellablePromiseInterface;
66
use React\EventLoop\LoopInterface;

tests/FunctionRejectTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?php
22

3-
use Clue\Promise\Timeout;
3+
use Clue\Promise\Timer;
44

55
class FunctionRejectTest extends TestCase
66
{
77
public function testPromiseIsPendingWithoutRunningLoop()
88
{
9-
$promise = Timeout\reject(0.01, $this->loop);
9+
$promise = Timer\reject(0.01, $this->loop);
1010

1111
$this->expectPromisePending($promise);
1212
}
1313

1414
public function testPromiseWillBeRejectedOnTimeout()
1515
{
16-
$promise = Timeout\reject(0.01, $this->loop);
16+
$promise = Timer\reject(0.01, $this->loop);
1717

1818
$this->loop->run();
1919

tests/FunctionResolveTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?php
22

3-
use Clue\Promise\Timeout;
3+
use Clue\Promise\Timer;
44

55
class FunctionResolveTest extends TestCase
66
{
77
public function testPromiseIsPendingWithoutRunningLoop()
88
{
9-
$promise = Timeout\resolve(0.01, $this->loop);
9+
$promise = Timer\resolve(0.01, $this->loop);
1010

1111
$this->expectPromisePending($promise);
1212
}
1313

1414
public function testPromiseWillBeResolvedOnTimeout()
1515
{
16-
$promise = Timeout\resolve(0.01, $this->loop);
16+
$promise = Timer\resolve(0.01, $this->loop);
1717

1818
$this->loop->run();
1919

tests/FunctionTimeoutTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22

3-
use Clue\Promise\Timeout;
3+
use Clue\Promise\Timer;
44
use React\Promise;
55

6-
class FunctionTimeoutTest extends TestCase
6+
class FunctionTimerTest extends TestCase
77
{
88
public function testResolvedWillResolveRightAway()
99
{
1010
$promise = Promise\resolve();
1111

12-
$promise = Timeout\timeout($promise, 3, $this->loop);
12+
$promise = Timer\timeout($promise, 3, $this->loop);
1313

1414
$this->expectPromiseResolved($promise);
1515
}
@@ -18,7 +18,7 @@ public function testResolvedWillNotStartTimer()
1818
{
1919
$promise = Promise\resolve();
2020

21-
Timeout\timeout($promise, 3, $this->loop);
21+
Timer\timeout($promise, 3, $this->loop);
2222

2323
$time = microtime(true);
2424
$this->loop->run();
@@ -31,7 +31,7 @@ public function testRejectedWillRejectRightAway()
3131
{
3232
$promise = Promise\reject();
3333

34-
$promise = Timeout\timeout($promise, 3, $this->loop);
34+
$promise = Timer\timeout($promise, 3, $this->loop);
3535

3636
$this->expectPromiseRejected($promise);
3737
}
@@ -40,7 +40,7 @@ public function testRejectedWillNotStartTimer()
4040
{
4141
$promise = Promise\reject();
4242

43-
Timeout\timeout($promise, 3, $this->loop);
43+
Timer\timeout($promise, 3, $this->loop);
4444

4545
$time = microtime(true);
4646
$this->loop->run();
@@ -53,7 +53,7 @@ public function testPendingWillRejectOnTimeout()
5353
{
5454
$promise = $this->getMock('React\Promise\PromiseInterface');
5555

56-
$promise = Timeout\timeout($promise, 0.01, $this->loop);
56+
$promise = Timer\timeout($promise, 0.01, $this->loop);
5757

5858
$this->loop->run();
5959

@@ -70,7 +70,7 @@ public function testPendingCancellableWillBeCancelledOnTimeout()
7070
$promise->expects($this->once())->method('cancel');
7171

7272

73-
Timeout\timeout($promise, 0.01, $this->loop);
73+
Timer\timeout($promise, 0.01, $this->loop);
7474

7575
$this->loop->run();
7676
}

tests/TimeoutExceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use Clue\Promise\Timeout\TimeoutException;
3+
use Clue\Promise\Timer\TimeoutException;
44

55
class TimeoutExceptionTest extends TestCase
66
{

0 commit comments

Comments
 (0)