@@ -51,11 +51,6 @@ class ConfigShowCommand extends Command
51
51
*/
52
52
private $ metadataProcessor ;
53
53
54
- /**
55
- * @var string
56
- */
57
- private $ сonfigPath ;
58
-
59
54
/**
60
55
* @param ValidatorInterface $scopeValidator
61
56
* @param ConfigSourceInterface $configSource
@@ -77,7 +72,7 @@ public function __construct(
77
72
}
78
73
79
74
/**
80
- * { @inheritdoc}
75
+ * @inheritdoc
81
76
*/
82
77
protected function configure ()
83
78
{
@@ -117,11 +112,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
117
112
{
118
113
$ scope = $ input ->getOption (self ::INPUT_OPTION_SCOPE );
119
114
$ scopeCode = $ input ->getOption (self ::INPUT_OPTION_SCOPE_CODE );
120
- $ this -> сonfigPath = $ input ->getArgument (self ::INPUT_ARGUMENT_PATH );
115
+ $ inputPath = $ input ->getArgument (self ::INPUT_ARGUMENT_PATH );
121
116
122
117
try {
123
118
$ this ->scopeValidator ->isValid ($ scope , $ scopeCode );
124
- $ configPath = $ this ->pathResolver ->resolve ($ this -> сonfigPath , $ scope , $ scopeCode );
119
+ $ configPath = $ this ->pathResolver ->resolve ($ inputPath , $ scope , $ scopeCode );
125
120
$ configValue = $ this ->configSource ->get ($ configPath );
126
121
} catch (LocalizedException $ e ) {
127
122
$ output ->writeln (sprintf ('<error>%s</error> ' , $ e ->getMessage ()));
@@ -131,32 +126,34 @@ protected function execute(InputInterface $input, OutputInterface $output)
131
126
if ($ configValue === null ) {
132
127
$ output ->writeln (sprintf (
133
128
'<error>%s</error> ' ,
134
- __ ('Configuration for path: "%1" doesn \'t exist ' , $ this -> сonfigPath )->render ()
129
+ __ ('Configuration for path: "%1" doesn \'t exist ' , $ inputPath )->render ()
135
130
));
136
131
return Cli::RETURN_FAILURE ;
137
132
}
138
133
139
- $ this ->outputResult ($ output , $ configValue , $ this -> сonfigPath );
134
+ $ this ->outputResult ($ input , $ output , $ configValue , $ inputPath );
140
135
return Cli::RETURN_SUCCESS ;
141
136
}
142
137
143
138
/**
144
- * Output single configuration value or list of values if array given.
139
+ * Outputs single configuration value or list of values if array given.
145
140
*
146
- * @param OutputInterface $output An OutputInterface instance
141
+ * @param InputInterface $input an InputInterface instance
142
+ * @param OutputInterface $output an OutputInterface instance
147
143
* @param mixed $configValue single value or array of values
148
144
* @param string $configPath base configuration path
149
145
* @return void
150
146
*/
151
- private function outputResult (OutputInterface $ output , $ configValue , $ configPath )
147
+ private function outputResult (InputInterface $ input , OutputInterface $ output , $ configValue , $ configPath )
152
148
{
153
149
if (!is_array ($ configValue )) {
154
150
$ value = $ this ->metadataProcessor ->processValue ($ configValue , $ configPath );
155
- $ output ->writeln ($ this ->сonfigPath === $ configPath ? $ value : sprintf ("%s - %s " , $ configPath , $ value ));
151
+ $ inputPath = $ input ->getArgument (self ::INPUT_ARGUMENT_PATH );
152
+ $ output ->writeln ($ inputPath === $ configPath ? $ value : sprintf ("%s - %s " , $ configPath , $ value ));
156
153
} else if (is_array ($ configValue )) {
157
154
foreach ($ configValue as $ name => $ value ) {
158
155
$ childPath = empty ($ configPath ) ? $ name : ($ configPath . '/ ' . $ name );
159
- $ this ->outputResult ($ output , $ value , $ childPath );
156
+ $ this ->outputResult ($ input , $ output , $ value , $ childPath );
160
157
}
161
158
}
162
159
}
0 commit comments