@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $value = $this->argument('value'); |
72 | 72 | |
73 | 73 | if (is_null($value) || !$value) { |
74 | - $parts = explode('=', (string)$key, 2); |
|
74 | + $parts = explode('=', (string) $key, 2); |
|
75 | 75 | |
76 | 76 | if (count($parts) !== 2) { |
77 | 77 | throw new InvalidArgumentException('No value was set'); |
@@ -80,15 +80,15 @@ discard block |
||
80 | 80 | [$key, $value] = $parts; |
81 | 81 | } |
82 | 82 | |
83 | - if (Str::contains((string)$key, '=')) { |
|
83 | + if (Str::contains((string) $key, '=')) { |
|
84 | 84 | throw new InvalidArgumentException("Environment key should not contain '='"); |
85 | 85 | } |
86 | 86 | |
87 | - if (!$this->isValidKey((string)$key)) { |
|
87 | + if (!$this->isValidKey((string) $key)) { |
|
88 | 88 | throw new InvalidArgumentException('Invalid argument key'); |
89 | 89 | } |
90 | 90 | |
91 | - return [(string)$key, (string)$value]; |
|
91 | + return [(string) $key, (string) $value]; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | foreach ($env_lines as $line) { |
29 | 29 | if (strlen(trim($line)) && !(strpos(trim($line), '#') === 0)) { |
30 | - [$key, $val] = explode('=', (string)$line); |
|
30 | + [$key, $val] = explode('=', (string) $line); |
|
31 | 31 | $this->_envVars[$key] = $this->_stripValue($val); |
32 | 32 | } |
33 | 33 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | */ |
56 | 56 | public function handle() |
57 | 57 | { |
58 | - $this->json = (bool)$this->option('json'); |
|
58 | + $this->json = (bool) $this->option('json'); |
|
59 | 59 | |
60 | 60 | $this->env = new Env(); |
61 | 61 | $this->line($this->_getEntireEnvContent()); |
@@ -44,14 +44,14 @@ |
||
44 | 44 | $key = $this->argument('key'); |
45 | 45 | |
46 | 46 | if (!is_null($key)) { |
47 | - $this->isValidKey((string)$key); |
|
47 | + $this->isValidKey((string) $key); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $env = new Env(); |
51 | - if (!$env->exists((string)$key)) { |
|
51 | + if (!$env->exists((string) $key)) { |
|
52 | 52 | $this->info("There is no variable {$key}"); |
53 | 53 | } else { |
54 | - $env->deleteVariable((string)$key); |
|
54 | + $env->deleteVariable((string) $key); |
|
55 | 55 | $this->info("Variable '{$key}' has been deleted"); |
56 | 56 | } |
57 | 57 | } |
@@ -69,14 +69,14 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function handle() |
71 | 71 | { |
72 | - $this->key = (string)$this->argument('key'); |
|
72 | + $this->key = (string) $this->argument('key'); |
|
73 | 73 | |
74 | 74 | if (strlen($this->key)) { |
75 | 75 | $this->isValidKey($this->key); |
76 | 76 | } |
77 | 77 | |
78 | - $this->json = (bool)$this->option('json'); |
|
79 | - $this->keyValFormat = (bool)$this->option('key-value'); |
|
78 | + $this->json = (bool) $this->option('json'); |
|
79 | + $this->keyValFormat = (bool) $this->option('key-value'); |
|
80 | 80 | $this->env = new Env(); |
81 | 81 | |
82 | 82 | return $this->_printOutput(); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | $value = ($this->json) ? json_encode($this->env->getKeyValue($this->key)) : ($this->keyValFormat ? $this->env->getKeyValue($this->key) : $this->env->getValue($this->key)); |
94 | 94 | |
95 | - return($this->json) ? (string)$value : ($this->keyValFormat ? "{$this->key}={$value[$this->key]}" : (string)$value); |
|
95 | + return($this->json) ? (string) $value : ($this->keyValFormat ? "{$this->key}={$value[$this->key]}" : (string) $value); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | private function _printOutput(): void |