$this->cost]); } public function isPasswordValid(UserInterface $user, string $plainPassword): bool { return password_verify($plainPassword, $user->getPassword()); } public function setCost(int $cost): void { if ($cost < 4 || $cost > 31) { throw new \InvalidArgumentException('Cost must be in the range of 4-31.'); } $this->cost = $cost; } }