Skip to content

Commit d0701c2

Browse files
committed
Put $delay and $interval at the first places of their respective methods
Closes #54
1 parent 4dce408 commit d0701c2

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/Loop.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,29 +127,29 @@ public static function defer(callable $callback, $data = null)
127127
/**
128128
* Delay the execution of a callback. The time delay is approximate and accuracy is not guaranteed.
129129
*
130-
* @param callable(string $watcherId, mixed $data) $callback The callback to delay.
131130
* @param int $time The amount of time, in milliseconds, to delay the execution for.
131+
* @param callable(string $watcherId, mixed $data) $callback The callback to delay.
132132
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
133133
*
134134
* @return string An identifier that can be used to cancel, enable or disable the watcher.
135135
*/
136-
public static function delay(callable $callback, $time, $data = null)
136+
public static function delay($time, callable $callback, $data = null)
137137
{
138-
return self::get()->delay($callback, $time, $data);
138+
return self::get()->delay($time, $callback, $data);
139139
}
140140

141141
/**
142142
* Repeatedly execute a callback. The interval between executions is approximate and accuracy is not guaranteed.
143143
*
144-
* @param callable(string $watcherId, mixed $data) $callback The callback to repeat.
145144
* @param int $interval The time interval, in milliseconds, to wait between executions.
145+
* @param callable(string $watcherId, mixed $data) $callback The callback to repeat.
146146
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
147147
*
148148
* @return string An identifier that can be used to cancel, enable or disable the watcher.
149149
*/
150-
public static function repeat(callable $callback, $interval, $data = null)
150+
public static function repeat($interval, callable $callback, $data = null)
151151
{
152-
return self::get()->repeat($callback, $interval, $data);
152+
return self::get()->repeat($interval, $callback, $data);
153153
}
154154

155155
/**

src/LoopDriver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@ public function defer(callable $callback, $data = null);
3131
/**
3232
* Delay the execution of a callback. The time delay is approximate and accuracy is not guaranteed.
3333
*
34-
* @param callable(string $watcherId, mixed $data) $callback The callback to delay.
3534
* @param int $delay The amount of time, in milliseconds, to delay the execution for.
35+
* @param callable(string $watcherId, mixed $data) $callback The callback to delay.
3636
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
3737
*
3838
* @return string An identifier that can be used to cancel, enable or disable the watcher.
3939
*/
40-
public function delay(callable $callback, $delay, $data = null);
40+
public function delay($delay, callable $callback, $data = null);
4141

4242
/**
4343
* Repeatedly execute a callback. The interval between executions is approximate and accuracy is not guaranteed.
4444
*
45-
* @param callable(string $watcherId, mixed $data) $callback The callback to repeat.
4645
* @param int $interval The time interval, in milliseconds, to wait between executions.
46+
* @param callable(string $watcherId, mixed $data) $callback The callback to repeat.
4747
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
4848
*
4949
* @return string An identifier that can be used to cancel, enable or disable the watcher.
5050
*/
51-
public function repeat(callable $callback, $interval, $data = null);
51+
public function repeat($interval, callable $callback, $data = null);
5252

5353
/**
5454
* Execute a callback when a stream resource becomes readable.

0 commit comments

Comments
 (0)