public function password(string $defaultPassword = null)
    {
        if (!$this->parsedUri->hasUser()) {
            return null;
        }

        if ($this->parsedUri->hasPassword()) {
            return $this->parsedUri->password();
        }

        return $defaultPassword;
    }
public function password(string $defaultPassword = null)
    {
        if (!$this->parsedUri->hasUser()) {
            return null;
        }

        if ($this->parsedUri->hasPassword()) {
            return $this->parsedUri->password();
        }

        return $defaultPassword;
    }
public function password ( string $ defaultPassword = null ) { if ( ! $ this -> parsedUri -> hasUser ( ) ) { return null ; } if ( $ this -> parsedUri -> hasPassword ( ) ) { return $ this -> parsedUri -> password ( ) ; } return $ defaultPassword ; }
returns the password

@param   string  $defaultPassword  password to return if no password is set
@return  string|null
@deprecated  since 8.0.0, passing a password via URI is inherintly insecure, will be removed with 9.0.0
returns the password