Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test and fix conditional for #22. #23

Merged
merged 3 commits into from
Feb 13, 2020
Merged

Conversation

mazedlx
Copy link
Contributor

@mazedlx mazedlx commented Feb 12, 2020

Added a test and fixed the corresponding conditional since 0 is a valid port number.

src/Ssh.php Outdated
@@ -111,7 +111,7 @@ protected function getExtraOptions(): string
$extraOptions[] = "-i {$this->pathToPrivateKey}";
}

if ($this->port) {
if (null !== $this->port) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A port can not be a negative integer ... the usePort method should also be changed to throw exception for negative integer

@@ -1,3 +1,3 @@
ssh user@example.com 'bash -se' << \EOF-SPATIE-SSH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems in correct, the -p flag should not appear if there is no specific port number.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, missed that, fixed with the next commit.

@freekmurze freekmurze merged commit 10d34d1 into spatie:master Feb 13, 2020
@freekmurze
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants