From 76f6bc8aadc9ffd4ec3dabf41e9891cf71975163 Mon Sep 17 00:00:00 2001 From: Everton da Rosa Date: Wed, 30 Oct 2024 11:36:23 -0300 Subject: [PATCH] feat: Adds methods in Progress to return the current value and total 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 --- src/TerminalObject/Dynamic/Progress.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/TerminalObject/Dynamic/Progress.php b/src/TerminalObject/Dynamic/Progress.php index e673eda3..7cb4e3d7 100644 --- a/src/TerminalObject/Dynamic/Progress.php +++ b/src/TerminalObject/Dynamic/Progress.php @@ -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; + } }