timer listening $time parameter correctly renamed
This commit is contained in:
parent
74decfd1d9
commit
a8b50378d9
@ -25,14 +25,14 @@ class TimerListening {
|
|||||||
*
|
*
|
||||||
* @param TimerListener $listener
|
* @param TimerListener $listener
|
||||||
* @param string $method
|
* @param string $method
|
||||||
* @param float $deltaSeconds
|
* @param float $milliSeconds
|
||||||
* @param bool $oneTime
|
* @param bool $oneTime
|
||||||
* @param bool $instantCall
|
* @param bool $instantCall
|
||||||
*/
|
*/
|
||||||
public function __construct(TimerListener $listener, $method, $deltaSeconds, $oneTime = false, $instantCall = true) {
|
public function __construct(TimerListener $listener, $method, $milliSeconds, $oneTime = false, $instantCall = true) {
|
||||||
$this->listener = $listener;
|
$this->listener = $listener;
|
||||||
$this->method = $method;
|
$this->method = $method;
|
||||||
$this->deltaTime = $deltaSeconds / 1000.;
|
$this->deltaTime = $milliSeconds / 1000.;
|
||||||
$this->oneTime = (bool)$oneTime;
|
$this->oneTime = (bool)$oneTime;
|
||||||
$this->instantCall = (bool)$instantCall;
|
$this->instantCall = (bool)$instantCall;
|
||||||
if (!$this->instantCall) {
|
if (!$this->instantCall) {
|
||||||
|
@ -32,10 +32,10 @@ class TimerManager {
|
|||||||
*
|
*
|
||||||
* @param TimerListener $listener
|
* @param TimerListener $listener
|
||||||
* @param string $method
|
* @param string $method
|
||||||
* @param float $seconds
|
* @param float $milliSeconds
|
||||||
*/
|
*/
|
||||||
public function registerOneTimeListening(TimerListener $listener, $method, $seconds) {
|
public function registerOneTimeListening(TimerListener $listener, $method, $milliSeconds) {
|
||||||
$this->registerTimerListening($listener, $method, $seconds, true);
|
$this->registerTimerListening($listener, $method, $milliSeconds, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,18 +43,18 @@ class TimerManager {
|
|||||||
*
|
*
|
||||||
* @param TimerListener $listener
|
* @param TimerListener $listener
|
||||||
* @param string $method
|
* @param string $method
|
||||||
* @param float $seconds
|
* @param float $milliSeconds
|
||||||
* @param bool $oneTime
|
* @param bool $oneTime
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function registerTimerListening(TimerListener $listener, $method, $seconds, $oneTime = false) {
|
public function registerTimerListening(TimerListener $listener, $method, $milliSeconds, $oneTime = false) {
|
||||||
if ((!is_string($method) || !method_exists($listener, $method)) && !is_callable($method)) {
|
if ((!is_string($method) || !method_exists($listener, $method)) && !is_callable($method)) {
|
||||||
trigger_error("Given Listener (" . get_class($listener) . ") can't handle Timer Callback (No Method '{$method}')!");
|
trigger_error("Given Listener (" . get_class($listener) . ") can't handle Timer Callback (No Method '{$method}')!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build Timer Listening
|
// Build Timer Listening
|
||||||
$listening = new TimerListening($listener, $method, $seconds, $oneTime);
|
$listening = new TimerListening($listener, $method, $milliSeconds, $oneTime);
|
||||||
array_push($this->timerListenings, $listening);
|
array_push($this->timerListenings, $listening);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user