Invert the "public" to a "private" method

This commit is contained in:
Joas Schilling 2015-07-07 11:30:21 +02:00
Родитель e5bc9d0619
Коммит 85f012512e
2 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -69,17 +69,17 @@ class ListConfigs extends Base {
'all' 'all'
) )
->addOption( ->addOption(
'public', 'private',
null, null,
InputOption::VALUE_NONE, InputOption::VALUE_NONE,
'Use this option when you want to exclude sensitive configs like passwords, salts, ...' 'Use this option when you want to include sensitive configs like passwords, salts, ...'
) )
; ;
} }
protected function execute(InputInterface $input, OutputInterface $output) { protected function execute(InputInterface $input, OutputInterface $output) {
$app = $input->getArgument('app'); $app = $input->getArgument('app');
$noSensitiveValues = $input->getOption('public'); $noSensitiveValues = !$input->getOption('private');
if ($noSensitiveValues && !$input->hasParameterOption('--output')) { if ($noSensitiveValues && !$input->hasParameterOption('--output')) {
// If you post this publicly we prefer the json format // If you post this publicly we prefer the json format

Просмотреть файл

@ -78,7 +78,7 @@ class ListConfigsTest extends TestCase {
'global_cache_gc_lastrun' => '1430388388', 'global_cache_gc_lastrun' => '1430388388',
]], ]],
], ],
true, false,
json_encode([ json_encode([
'system' => [ 'system' => [
'overwrite.cli.url' => 'http://localhost', 'overwrite.cli.url' => 'http://localhost',
@ -113,7 +113,7 @@ class ListConfigsTest extends TestCase {
'global_cache_gc_lastrun' => '1430388388', 'global_cache_gc_lastrun' => '1430388388',
]], ]],
], ],
false, true,
json_encode([ json_encode([
'system' => [ 'system' => [
'secret' => 'my secret', 'secret' => 'my secret',
@ -149,7 +149,7 @@ class ListConfigsTest extends TestCase {
'global_cache_gc_lastrun' => '1430388388', 'global_cache_gc_lastrun' => '1430388388',
]], ]],
], ],
true, false,
json_encode([ json_encode([
'system' => [ 'system' => [
'overwrite.cli.url' => 'http://localhost', 'overwrite.cli.url' => 'http://localhost',
@ -176,7 +176,7 @@ class ListConfigsTest extends TestCase {
'global_cache_gc_lastrun' => '1430388388', 'global_cache_gc_lastrun' => '1430388388',
]], ]],
], ],
false, true,
json_encode([ json_encode([
'system' => [ 'system' => [
'secret' => 'my secret', 'secret' => 'my secret',
@ -204,7 +204,7 @@ class ListConfigsTest extends TestCase {
'global_cache_gc_lastrun' => '1430388388', 'global_cache_gc_lastrun' => '1430388388',
]], ]],
], ],
true, false,
json_encode([ json_encode([
'apps' => [ 'apps' => [
'files' => [ 'files' => [
@ -233,7 +233,7 @@ class ListConfigsTest extends TestCase {
'global_cache_gc_lastrun' => '1430388388', 'global_cache_gc_lastrun' => '1430388388',
]], ]],
], ],
false, true,
json_encode([ json_encode([
'apps' => [ 'apps' => [
'files' => [ 'files' => [
@ -252,10 +252,10 @@ class ListConfigsTest extends TestCase {
* @param array $systemConfigs * @param array $systemConfigs
* @param array $systemConfigMap * @param array $systemConfigMap
* @param array $appConfig * @param array $appConfig
* @param bool $public * @param bool $private
* @param string $expected * @param string $expected
*/ */
public function testList($app, $systemConfigs, $systemConfigMap, $appConfig, $public, $expected) { public function testList($app, $systemConfigs, $systemConfigMap, $appConfig, $private, $expected) {
$this->systemConfig->expects($this->any()) $this->systemConfig->expects($this->any())
->method('getKeys') ->method('getKeys')
->willReturn($systemConfigs); ->willReturn($systemConfigs);
@ -279,7 +279,7 @@ class ListConfigsTest extends TestCase {
->method('getOption') ->method('getOption')
->willReturnMap([ ->willReturnMap([
['output', 'json'], ['output', 'json'],
['public', $public], ['private', $private],
]); ]);
global $output; global $output;