Skip to content

Commit bab9c04

Browse files
committed
float
1 parent 74c6f83 commit bab9c04

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/cli/Notify.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function elapsed() {
104104
* Calculates the speed (number of ticks per second) at which the Notifier
105105
* is being updated.
106106
*
107-
* @return int The number of ticks performed in 1 second.
107+
* @return float|int The number of ticks performed in 1 second.
108108
*/
109109
public function speed() {
110110
if (!$this->_start) {
@@ -121,7 +121,7 @@ public function speed() {
121121
$this->_speed = ($this->_current / $this->_iteration) / $span;
122122
}
123123

124-
return (int) $this->_speed;
124+
return $this->_speed;
125125
}
126126

127127
/**

lib/cli/Progress.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ public function total() {
9090
* Calculates the estimated total time for the tick count to reach the
9191
* total ticks given.
9292
*
93-
* @return int The estimated total number of seconds for all ticks to be
94-
* completed. This is not the estimated time left, but total.
93+
* @return int|float The estimated total number of seconds for all ticks to be
94+
* completed. This is not the estimated time left, but total.
9595
* @see cli\Notify::speed()
9696
* @see cli\Notify::elapsed()
9797
*/
@@ -102,7 +102,7 @@ public function estimated() {
102102
}
103103

104104
$estimated = round($this->_total / $speed);
105-
return (int)$estimated;
105+
return $estimated;
106106
}
107107

108108
/**

lib/cli/progress/Bar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function display($finish = false) {
8282
$total = $this->total();
8383
$msg = Streams::render($this->_formatMessage, compact('msg', 'percent', 'current', 'total'));
8484

85-
$estimated = $this->formatTime($this->estimated());
85+
$estimated = $this->formatTime((int)$this->estimated());
8686
$elapsed = str_pad($this->formatTime($this->elapsed()), strlen($estimated));
8787
$timing = Streams::render($this->_formatTiming, compact('elapsed', 'estimated', 'current', 'total', 'percent'));
8888

0 commit comments

Comments
 (0)