Skip to content

Commit

Permalink
feat: Adds methods in Progress to return the current value and total …
Browse files Browse the repository at this point in the history
…value of the progress bar.

This commit dds methods in Progress to return the current value and total value of the progress bar.

Tests not included because they are simple access methods to private properties of the class.

Issue #192
  • Loading branch information
everton3x committed Oct 30, 2024
1 parent 9e8a8b1 commit 76f6bc8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/TerminalObject/Dynamic/Progress.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,24 @@ protected function shouldRedraw($percentage, $label)
{
return ($this->force_redraw || $percentage != $this->current_percentage || $label != $this->label);
}

/**
* Gets the current progress value.
*
* @return int the current progress value.
*/
public function getCurrent()
{
return $this->current;
}

/**
* Gets the total value for progress.
*
* @return int The total progress value.
*/
public function getTotal()
{
return $this->total;
}
}

0 comments on commit 76f6bc8

Please sign in to comment.