From c8d1e77550476e67dc7b8cb1c55d75383c8ebd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sun, 5 Jul 2015 01:52:58 +0200 Subject: [PATCH] Rename wait() to sleep() in order to avoid confusion with await*() --- README.md | 4 ++-- src/Blocker.php | 2 +- tests/BlockerTest.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 902e118..66778c6 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,9 @@ $loop = React\EventLoop\Factory::create(); $blocker = new Blocker($loop); ``` -#### wait() +#### sleep() -The `wait($seconds)` method can be used to wait/sleep for $time seconds. +The `sleep($seconds)` method can be used to wait/sleep for $time seconds. #### awaitOne() diff --git a/src/Blocker.php b/src/Blocker.php index 63f3761..1c1a007 100644 --- a/src/Blocker.php +++ b/src/Blocker.php @@ -22,7 +22,7 @@ public function __construct(LoopInterface $loop) * * @param float $time */ - public function wait($time) + public function sleep($time) { $wait = true; $loop = $this->loop; diff --git a/tests/BlockerTest.php b/tests/BlockerTest.php index e0629e6..a4221ee 100644 --- a/tests/BlockerTest.php +++ b/tests/BlockerTest.php @@ -14,10 +14,10 @@ public function setUp() $this->block = new Blocker($this->loop); } - public function testWait() + public function testSleep() { $time = microtime(true); - $this->block->wait(0.2); + $this->block->sleep(0.2); $time = microtime(true) - $time; $this->assertEquals(0.2, $time, '', 0.1);