Skip to content

Commit 124f2e7

Browse files
committed
Code cleanup
1 parent faba972 commit 124f2e7

3 files changed

Lines changed: 10 additions & 18 deletions

File tree

Crypt/Console/PinCliParameters.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@ class PinCliParameters
77
private $verbose;
88
private $log;
99

10-
public function __construct($verbose = 0, $log = null) {
10+
public function __construct($verbose = 0, $log = null)
11+
{
1112
$this->verbose = $verbose;
1213
$this->log = $log;
1314
}
1415

15-
public function getVerbose() {
16+
public function getVerbose()
17+
{
1618
return $this->verbose;
1719
}
1820

19-
public function getLog() {
21+
public function getLog()
22+
{
2023
return $this->log;
2124
}
22-
}
25+
}

Crypt/Console/SimpleCliWrapper.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Crypt\Console;
44

5-
65
require_once __DIR__ . '/PinCliParameters.php';
76

87
class SimpleCliWrapper
@@ -93,7 +92,6 @@ public function parseCli()
9392
* }
9493
* ```
9594
*
96-
* @param $msg
9795
* @return void
9896
*/
9997
public function writeToErrOrEcho($msg)
@@ -128,10 +126,7 @@ private function printHelp()
128126
";
129127
}
130128

131-
132129
/**
133-
* @param array $opts
134-
*
135130
* @return int
136131
*/
137132
public static function getVerbosityLevel(array $opts)
@@ -140,7 +135,6 @@ public static function getVerbosityLevel(array $opts)
140135
return self::DEFAULT_VERBOSITY;
141136
}
142137

143-
144138
// the default options with just a -v is false, but based
145139
// on the old system, it would be level 0
146140
if (isset($opts[self::VERBOSE_SHORT])) {
@@ -164,11 +158,10 @@ public static function getVerbosityLevel(array $opts)
164158

165159
}
166160

167-
168161
public static function getLogLocation(array $opts)
169162
{
170163
if (!isset($opts[self::LOG_SHORT]) && !isset($opts[self::LOG_LONG])) {
171-
return "";
164+
return '';
172165
}
173166

174167
if (isset($opts[self::LOG_SHORT]) && is_string($opts[self::LOG_SHORT])) {
@@ -181,4 +174,4 @@ public static function getLogLocation(array $opts)
181174

182175
return self::INVALID_INPUT;
183176
}
184-
}
177+
}

scripts/crypt-gpg-pinentry

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55

66
// Check if we're running directly from git repo or if we're running
77
// from a PEAR or Composer packaged version.
8-
$ds = DIRECTORY_SEPARATOR;
9-
$root = __DIR__ . $ds . '..' ;
108
$paths = [
119
'@php-dir@', // PEAR or Composer
12-
$root, // Git (or Composer with wrong @php-dir@)
13-
// and composer-installed PEAR_Exception for Console_CommandLine (#21074)
14-
$root . $ds . '..' . $ds . '..' . $ds . 'pear' . $ds . 'pear_exception',
10+
__DIR__ . DIRECTORY_SEPARATOR . '..', // Git (or Composer with wrong @php-dir@)
1511
];
1612

1713
foreach ($paths as $idx => $path) {

0 commit comments

Comments
 (0)