mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 08:30:07 +01:00
Fix styleci & drop typehint for php5.6 compatibility
This commit is contained in:
@@ -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
|
||||
*/
|
||||
@@ -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
|
||||
*/
|
||||
@@ -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) {
|
||||
@@ -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)
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
@@ -361,7 +360,7 @@ public function test_getAllRunningServices_will_return_unique_services()
|
||||
'service1',
|
||||
'service2',
|
||||
'service3',
|
||||
'service4'
|
||||
'service4',
|
||||
], array_values($result->all()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user