Skip to content

Commit 6b49753

Browse files
committed
formatting
1 parent 4502c9b commit 6b49753

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

src/Illuminate/Foundation/Console/EnvironmentDecryptCommand.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class EnvironmentDecryptCommand extends Command
2222
{--key= : The encryption key}
2323
{--cipher= : The encryption cipher}
2424
{--env= : The environment to be decrypted}
25-
{--force : Overwrite existing environment file}
26-
{--filename= : Filename to which to write the decrypted contents}';
25+
{--force : Overwrite the existing environment file}
26+
{--filename= : Where to write the decrypted file contents}';
2727

2828
/**
2929
* The name of the console command.
@@ -50,6 +50,12 @@ class EnvironmentDecryptCommand extends Command
5050
*/
5151
protected $files;
5252

53+
/**
54+
* Create a new command instance.
55+
*
56+
* @param \Illuminate\Filesystem\Filesystem $files
57+
* @return void
58+
*/
5359
public function __construct(Filesystem $files)
5460
{
5561
parent::__construct();
@@ -73,12 +79,18 @@ public function handle()
7379
}
7480

7581
$cipher = $this->option('cipher') ?: 'aes-128-cbc';
82+
7683
$key = $this->parseKey($key);
84+
7785
$environmentFile = $this->option('env')
78-
? base_path('.env').'.'.$this->option('env')
79-
: $this->laravel->environmentFilePath();
86+
? base_path('.env').'.'.$this->option('env')
87+
: $this->laravel->environmentFilePath();
88+
8089
$encryptedFile = $environmentFile.'.encrypted';
81-
$filename = $this->option('filename') ? base_path($this->option('filename')) : $environmentFile;
90+
91+
$filename = $this->option('filename')
92+
? base_path($this->option('filename'))
93+
: $environmentFile;
8294

8395
if (Str::endsWith($filename, '.encrypted')) {
8496
$this->components->error('Invalid filename.');

src/Illuminate/Foundation/Console/EnvironmentEncryptCommand.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class EnvironmentEncryptCommand extends Command
2020
{--key= : The encryption key}
2121
{--cipher= : The encryption cipher}
2222
{--env= : The environment to be encrypted}
23-
{--force : Overwrite existing encrypted environment file}';
23+
{--force : Overwrite the existing encrypted environment file}';
2424

2525
/**
2626
* The name of the console command.
@@ -47,6 +47,12 @@ class EnvironmentEncryptCommand extends Command
4747
*/
4848
protected $files;
4949

50+
/**
51+
* Create a new command instance.
52+
*
53+
* @param \Illuminate\Filesystem\Filesystem $files
54+
* @return void
55+
*/
5056
public function __construct(Filesystem $files)
5157
{
5258
parent::__construct();
@@ -62,11 +68,15 @@ public function __construct(Filesystem $files)
6268
public function handle()
6369
{
6470
$cipher = $this->option('cipher') ?: 'aes-128-cbc';
71+
6572
$key = $this->option('key');
73+
6674
$keyPassed = $key !== null;
75+
6776
$environmentFile = $this->option('env')
6877
? base_path('.env').'.'.$this->option('env')
6978
: $this->laravel->environmentFilePath();
79+
7080
$encryptedFile = $environmentFile.'.encrypted';
7181

7282
if (! $keyPassed) {

0 commit comments

Comments
 (0)