diff --git a/src/Election.php b/src/Election.php index b2da2d0c..ee1c00c0 100644 --- a/src/Election.php +++ b/src/Election.php @@ -83,7 +83,7 @@ public static function setMaxVoteNumber( // Mechanics protected ElectionState $State = ElectionState::CANDIDATES_REGISTRATION; - protected Timer_Manager $timer; + protected readonly Timer_Manager $timer; // Params protected bool $ImplicitRanking = true; diff --git a/src/ElectionProcess/VotesProcess.php b/src/ElectionProcess/VotesProcess.php index 365db25b..696aeed9 100644 --- a/src/ElectionProcess/VotesProcess.php +++ b/src/ElectionProcess/VotesProcess.php @@ -24,7 +24,7 @@ trait VotesProcess /////////// CONSTRUCTOR /////////// // Data and global options - protected VotesManager $Votes; // Votes list + protected readonly VotesManager $Votes; // Votes list protected int $voteFastMode = 0; // When parsing vote, avoid unnecessary checks diff --git a/src/Result.php b/src/Result.php index 01c53388..6009a82d 100644 --- a/src/Result.php +++ b/src/Result.php @@ -84,7 +84,7 @@ public function count(): int protected readonly array $Result; protected array $ResultIterator; - protected $Stats; + public readonly mixed $Stats; protected array $warning = []; #[PublicAPI] diff --git a/src/Timer/Chrono.php b/src/Timer/Chrono.php index dcd9f33b..60238656 100644 --- a/src/Timer/Chrono.php +++ b/src/Timer/Chrono.php @@ -17,15 +17,15 @@ class Chrono { use CondorcetVersion; - protected Manager $manager; - protected float $start; + protected readonly Manager $manager; + public readonly float $start; protected ?string $role = null; public function __construct(Manager $timer, ?string $role = null) { $this->manager = $timer; $this->setRole($role); - $this->resetStart(); + $this->start = microtime(true); $this->managerStartDeclare(); } @@ -44,11 +44,6 @@ public function getTimerManager(): Manager return $this->manager; } - protected function resetStart(): void - { - $this->start = microtime(true); - } - public function getRole(): ?string { return $this->role;