Skip to content

Commit

Permalink
Fix styleci & drop typehint for php5.6 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiancalara committed Jan 8, 2022
1 parent 9e3a89c commit 70335ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cli/Valet/Brew.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public function getAllRunningServices()

/**
* Get the currently running brew services as root.
* i.e. /Library/LaunchDaemons (started at boot)
* i.e. /Library/LaunchDaemons (started at boot).
*
* @return \Illuminate\Support\Collection
*/
Expand All @@ -395,7 +395,7 @@ public function getRunningServicesAsRoot()

/**
* Get the currently running brew services.
* i.e. ~/Library/LaunchAgents (started at login)
* i.e. ~/Library/LaunchAgents (started at login).
*
* @return \Illuminate\Support\Collection
*/
Expand All @@ -410,7 +410,7 @@ public function getRunningServicesAsUser()
* @param bool $asUser
* @return \Illuminate\Support\Collection
*/
public function getRunningServices(bool $asUser = false)
public function getRunningServices($asUser = false)
{
$command = 'brew services list | grep started | awk \'{ print $1; }\'';
$onError = function ($exitCode, $errorOutput) {
Expand All @@ -421,7 +421,7 @@ public function getRunningServices(bool $asUser = false)

return collect(array_filter(explode(PHP_EOL, $asUser
? $this->cli->runAsUser($command, $onError)
: $this->cli->run('sudo ' . $command, $onError)
: $this->cli->run('sudo '.$command, $onError)
)));
}

Expand Down
3 changes: 1 addition & 2 deletions tests/BrewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ public function test_getAllRunningServices_will_return_both_root_and_user_servic
], array_values($result->all()));
}


public function test_getAllRunningServices_will_return_unique_services()
{
$cli = Mockery::mock(CommandLine::class);
Expand All @@ -361,7 +360,7 @@ public function test_getAllRunningServices_will_return_unique_services()
'service1',
'service2',
'service3',
'service4'
'service4',
], array_values($result->all()));
}

Expand Down

0 comments on commit 70335ba

Please sign in to comment.