public function setPassword(string $newPassword): void
    {
        //hash provided password
        $this->password = $this->passwordUtility->hash($newPassword);
    }
public function setPassword(string $newPassword): void
    {
        //hash provided password
        $this->password = $this->passwordUtility->hash($newPassword);
    }
public function setPassword ( string $ newPassword ) : void { //hash provided password $ this -> password = $ this -> passwordUtility -> hash ( $ newPassword ) ; }
Set new user password without do any check.

<pre><code class="php">$password = new Password();

$user = new User($password);

$user->setPassword('newPassword');
</code></pre>

@param string $newPassword

@return void
Set new user password without do any check .