@@ -32,7 +32,7 @@ public function __construct(
3232 */
3333 public function addEnforcedDependency (
3434 string $ module ,
35- array $ configNames
35+ array $ configNames,
3636 ): void {
3737 foreach ($ configNames as $ name ) {
3838 $ this ->logger ->info (sprintf ('Config name: %s ' , $ name ));
@@ -54,7 +54,7 @@ public function addEnforcedDependency(
5454 */
5555 public function removeEnforcedDependency (
5656 string $ module ,
57- array $ configNames
57+ array $ configNames,
5858 ): void {
5959 foreach ($ configNames as $ name ) {
6060 $ this ->logger ->info (sprintf ('Config name: %s ' , $ name ));
@@ -86,7 +86,7 @@ public function removeEnforcedDependency(
8686 public function writeModuleConfig (
8787 string $ module ,
8888 mixed $ optional ,
89- array $ configNames
89+ array $ configNames,
9090 ): void {
9191 $ moduleConfigPath = $ this ->getModuleConfigPath ($ module , $ optional );
9292 if (!is_dir ($ moduleConfigPath )) {
@@ -113,28 +113,28 @@ public function renameConfig(
113113 string $ from ,
114114 string $ to ,
115115 array $ configNames ,
116- bool $ regex = FALSE
116+ bool $ regex = FALSE ,
117117 ): void {
118118 $ replacer = $ regex
119119 ? static fn (string $ subject ) => preg_replace ($ from , $ to , $ subject )
120120 : static fn (string $ subject ) => str_replace ($ from , $ to , $ subject );
121121
122- foreach ($ configNames as $ name ) {
123- $ config = $ this ->configFactory ->getEditable ($ name );
124- $ data = $ config ->getRawData ();
125- $ newData = $ this ->replaceKeysAndValues ($ replacer , $ data );
126- if ($ newData !== $ data ) {
127- $ config ->setData ($ newData );
128- $ this ->logger ->info (sprintf ('Saving updated config %s ' , $ name ));
129- $ config ->save ();
130- }
122+ foreach ($ configNames as $ name ) {
123+ $ config = $ this ->configFactory ->getEditable ($ name );
124+ $ data = $ config ->getRawData ();
125+ $ newData = $ this ->replaceKeysAndValues ($ replacer , $ data );
126+ if ($ newData !== $ data ) {
127+ $ config ->setData ($ newData );
128+ $ this ->logger ->info (sprintf ('Saving updated config %s ' , $ name ));
129+ $ config ->save ();
130+ }
131131
132- $ newName = $ replacer ($ name );
133- if ($ newName !== $ name ) {
134- $ this ->logger ->info (sprintf ('Renaming config %s to %s ' , $ name , $ newName ));
135- $ this ->configFactory ->rename ($ name , $ newName );
136- }
132+ $ newName = $ replacer ($ name );
133+ if ($ newName !== $ name ) {
134+ $ this ->logger ->info (sprintf ('Renaming config %s to %s ' , $ name , $ newName ));
135+ $ this ->configFactory ->rename ($ name , $ newName );
137136 }
137+ }
138138 }
139139
140140 /**
@@ -218,7 +218,7 @@ public function getModuleConfigPath(string $module, bool $optional): string {
218218 */
219219 private function replaceKeysAndValues (
220220 callable $ replacer ,
221- array $ input
221+ array $ input,
222222 ): array {
223223 $ return = [];
224224 foreach ($ input as $ key => $ value ) {
0 commit comments