Submit
Path:
~
/
/
usr
/
local
/
psa
/
admin
/
plib
/
modules
/
wp-toolkit
/
vendor
/
cerbero
/
json-parser
/
src
/
ValueObjects
/
File Content:
Progress.php
<?php namespace WPToolkitDependenciesIsolationPrefix\Cerbero\JsonParser\ValueObjects; use function is_null; /** * The parsing progress. * */ final class Progress { /** * The current progress. * * @var int */ private int $current = 0; /** * The total possible progress. * * @var int|null */ private ?int $total = null; /** * Set the current progress * * @param int $current * @return self */ public function setCurrent(int $current) : self { $this->current = $current; return $this; } /** * Retrieve the current progress * * @return int */ public function current() : int { return $this->current; } /** * Set the total possible progress * * @param int|null $total * @return self */ public function setTotal(?int $total) : self { $this->total ??= $total; return $this; } /** * Retrieve the total possible progress * * @return int|null */ public function total() : ?int { return $this->total; } /** * Retrieve the formatted percentage of the progress * * @return string|null */ public function format() : ?string { return is_null($percentage = $this->percentage()) ? null : \number_format($percentage, 1) . '%'; } /** * Retrieve the percentage of the progress * * @return float|null */ public function percentage() : ?float { return is_null($fraction = $this->fraction()) ? null : $fraction * 100; } /** * Retrieve the fraction of the progress * * @return float|null */ public function fraction() : ?float { return $this->total ? $this->current / $this->total : null; } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
Config.php
2292 bytes
0644
Progress.php
1864 bytes
0644
State.php
2954 bytes
0644
Tree.php
4778 bytes
0644
N4ST4R_ID | Naxtarrr