Skip to content

Commit

Permalink
Because style is nice, and timeout before host
Browse files Browse the repository at this point in the history
  • Loading branch information
mlantz committed May 17, 2020
1 parent dbc68df commit 5b2e49f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/SecLibGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public function __construct($host, array $auth, Filesystem $files, $timeout)
{
$this->auth = $auth;
$this->files = $files;
$this->setHostAndPort($host);
$this->setTimeout($timeout);
$this->setHostAndPort($host);
}

/**
Expand All @@ -86,7 +86,7 @@ protected function setHostAndPort($host)

if (!filter_var($host, FILTER_VALIDATE_IP) && Str::contains($host, ':')) {
$this->host = Str::beforeLast($host, ':');
$this->port = (int)Str::afterLast($host, ':');
$this->port = (int) Str::afterLast($host, ':');
}

if (filter_var($this->host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/RemoteSecLibTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function getGateway($host = '127.0.0.1:22')
$files = m::mock('Illuminate\Filesystem\Filesystem');
$files->shouldReceive('get')->with('keypath')->andReturn('keystuff');
$gateway = m::mock('Collective\Remote\SecLibGateway[!setTimeout]', [
'127.0.0.1:22',
$host,
['username' => 'taylor', 'key' => 'keypath', 'keyphrase' => 'keyphrase'],
$files,
10,
Expand Down

0 comments on commit 5b2e49f

Please sign in to comment.