Apply fixes from StyleCI

This commit is contained in:
Marcel Pociot
2020-06-17 10:35:07 +00:00
committed by StyleCI Bot
parent 0e33bc7d99
commit 83676deddb
56 changed files with 189 additions and 316 deletions

View File

@@ -15,17 +15,18 @@ class PublishCommand extends Command
$configFile = implode(DIRECTORY_SEPARATOR, [
$_SERVER['HOME'],
'.expose',
'config.php'
'config.php',
]);
if (! $this->option('force') && file_exists($configFile)) {
$this->error('Expose configuration file already exists at '.$configFile);
return;
}
@mkdir(dirname($configFile), 0755, true);
file_put_contents($configFile, file_get_contents(base_path('config/expose.php')));
$this->info('Published expose configuration file to: ' . $configFile);
$this->info('Published expose configuration file to: '.$configFile);
}
}

View File

@@ -18,7 +18,7 @@ class ServeCommand extends Command
$loop = app(LoopInterface::class);
$loop->futureTick(function () {
$this->info("Expose server running on port ".$this->option('port').".");
$this->info('Expose server running on port '.$this->option('port').'.');
});
$validateAuthTokens = config('expose.admin.validate_auth_tokens');

View File

@@ -4,7 +4,6 @@ namespace App\Commands;
use App\Client\Factory;
use App\Logger\CliRequestLogger;
use Illuminate\Console\Scheduling\Schedule;
use LaravelZero\Framework\Commands\Command;
use React\EventLoop\LoopInterface;
use Symfony\Component\Console\Output\ConsoleOutput;

View File

@@ -2,8 +2,6 @@
namespace App\Commands;
use Illuminate\Console\Command;
class ShareCurrentWorkingDirectoryCommand extends ShareCommand
{
protected $signature = 'share-cwd {host?} {--subdomain=} {--auth=}';
@@ -21,10 +19,11 @@ class ShareCurrentWorkingDirectoryCommand extends ShareCommand
protected function detectTld(): string
{
$valetConfigFile = $_SERVER['HOME'] . DIRECTORY_SEPARATOR . '.config' . DIRECTORY_SEPARATOR . 'valet' . DIRECTORY_SEPARATOR . 'config.json';
$valetConfigFile = $_SERVER['HOME'].DIRECTORY_SEPARATOR.'.config'.DIRECTORY_SEPARATOR.'valet'.DIRECTORY_SEPARATOR.'config.json';
if (file_exists($valetConfigFile)) {
$valetConfig = json_decode(file_get_contents($valetConfigFile));
return $valetConfig->tld;
}

View File

@@ -8,7 +8,6 @@ use PhpParser\Lexer\Emulative;
use PhpParser\NodeTraverser;
use PhpParser\NodeVisitor\CloningVisitor;
use PhpParser\Parser\Php7;
use PhpParser\ParserFactory;
use PhpParser\PrettyPrinter\Standard;
class StoreAuthenticationTokenCommand extends Command
@@ -21,13 +20,13 @@ class StoreAuthenticationTokenCommand extends Command
{
$config = config('expose', []);
if (!is_null($this->argument('token'))) {
$this->info('Setting the expose authentication token to "' . $this->argument('token') . '"');
if (! is_null($this->argument('token'))) {
$this->info('Setting the expose authentication token to "'.$this->argument('token').'"');
$configFile = implode(DIRECTORY_SEPARATOR, [
$_SERVER['HOME'],
'.expose',
'config.php'
'config.php',
]);
if (! file_exists($configFile)) {
@@ -38,13 +37,14 @@ class StoreAuthenticationTokenCommand extends Command
}
file_put_contents($configFile, $updatedConfigFile);
return;
}
if (is_null($token = config('expose.auth_token'))) {
$this->info('There is no authentication token specified.');
} else {
$this->info('Current authentication token: ' . $token);
$this->info('Current authentication token: '.$token);
}
}