@@ -36,19 +36,26 @@ class IndexerShowDimensionsModeCommand extends AbstractIndexerCommand
36
36
* @var string[]
37
37
*/
38
38
private $ indexers ;
39
+ /**
40
+ * @var string[]
41
+ */
42
+ private $ optionalIndexers ;
39
43
40
44
/**
41
45
* @param ObjectManagerFactory $objectManagerFactory
42
46
* @param ScopeConfigInterface $configReader
43
47
* @param array $indexers
48
+ * @param array $optionalIndexers
44
49
*/
45
50
public function __construct (
46
51
ObjectManagerFactory $ objectManagerFactory ,
47
52
ScopeConfigInterface $ configReader ,
48
- array $ indexers
53
+ array $ indexers ,
54
+ array $ optionalIndexers
49
55
) {
50
56
$ this ->configReader = $ configReader ;
51
57
$ this ->indexers = $ indexers ;
58
+ $ this ->optionalIndexers = $ optionalIndexers ;
52
59
parent ::__construct ($ objectManagerFactory );
53
60
}
54
61
@@ -92,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
92
99
$ output ->writeln (sprintf ('%-50s ' , $ indexer ->getTitle () . ': ' ) . $ mode );
93
100
}
94
101
} catch (\Exception $ e ) {
95
- if ($ e instanceof \InvalidArgumentException && $ indexerId !== ' catalogpermissions_category ' ) {
102
+ if (! in_array ( $ indexerId, $ this -> optionalIndexers ) ) {
96
103
$ output ->writeln ('" ' . $ indexer ->getTitle () . '" indexer process unknown error: ' . PHP_EOL );
97
104
$ output ->writeln ($ e ->getMessage () . PHP_EOL );
98
105
// we must have an exit code higher than zero to indicate something was wrong
@@ -114,7 +121,7 @@ private function getInputList(): array
114
121
$ arguments [] = new InputArgument (
115
122
self ::INPUT_KEY_INDEXER ,
116
123
InputArgument::OPTIONAL | InputArgument::IS_ARRAY ,
117
- $ optionDescription . ' ( ' . implode ($ this ->indexers ) . ') '
124
+ $ optionDescription . ' ( ' . implode (' , ' , $ this ->indexers ) . ') '
118
125
);
119
126
120
127
return $ arguments ;
0 commit comments