@@ -1012,7 +1012,7 @@ private function throwExceptionForNotWritablePaths(array $paths)
1012
1012
*/
1013
1013
private function handleDBSchemaData ($ setup , $ type , array $ request )
1014
1014
{
1015
- if (!( $ type === 'schema ' || $ type === 'data ' ) ) {
1015
+ if ($ type !== 'schema ' && $ type !== 'data ' ) {
1016
1016
// phpcs:ignore Magento2.Exceptions.DirectThrow
1017
1017
throw new Exception ("Unsupported operation type $ type is requested " );
1018
1018
}
@@ -1031,17 +1031,13 @@ private function handleDBSchemaData($setup, $type, array $request)
1031
1031
'objectManager ' => $ this ->objectManagerProvider ->get ()
1032
1032
]
1033
1033
);
1034
+
1035
+ $ patchApplierParams = $ type === 'schema ' ?
1036
+ ['schemaSetup ' => $ setup ] :
1037
+ ['moduleDataSetup ' => $ setup , 'objectManager ' => $ this ->objectManagerProvider ->get ()];
1038
+
1034
1039
/** @var PatchApplier $patchApplier */
1035
- if ($ type === 'schema ' ) {
1036
- $ patchApplier = $ this ->patchApplierFactory ->create (['schemaSetup ' => $ setup ]);
1037
- } elseif ($ type === 'data ' ) {
1038
- $ patchApplier = $ this ->patchApplierFactory ->create (
1039
- [
1040
- 'moduleDataSetup ' => $ setup ,
1041
- 'objectManager ' => $ this ->objectManagerProvider ->get ()
1042
- ]
1043
- );
1044
- }
1040
+ $ patchApplier = $ this ->patchApplierFactory ->create ($ patchApplierParams );
1045
1041
1046
1042
foreach ($ moduleNames as $ moduleName ) {
1047
1043
if ($ this ->isDryRun ($ request )) {
@@ -1103,11 +1099,11 @@ private function handleDBSchemaData($setup, $type, array $request)
1103
1099
1104
1100
if ($ type === 'schema ' ) {
1105
1101
$ this ->log ->log ('Schema post-updates: ' );
1106
- $ handlerType = 'schema-recurring ' ;
1107
1102
} elseif ($ type === 'data ' ) {
1108
1103
$ this ->log ->log ('Data post-updates: ' );
1109
- $ handlerType = 'data-recurring ' ;
1110
1104
}
1105
+ $ handlerType = $ type === 'schema ' ? 'schema-recurring ' : 'data-recurring ' ;
1106
+
1111
1107
foreach ($ moduleNames as $ moduleName ) {
1112
1108
if ($ this ->isDryRun ($ request )) {
1113
1109
$ this ->log ->log ("Module ' {$ moduleName }': " );
@@ -1745,6 +1741,8 @@ public function removeUnusedTriggers(): void
1745
1741
}
1746
1742
1747
1743
/**
1744
+ * Returns list of disabled cache types
1745
+ *
1748
1746
* @param array $cacheTypesToCheck
1749
1747
* @return array
1750
1748
*/
@@ -1761,7 +1759,7 @@ private function getDisabledCacheTypes(array $cacheTypesToCheck): array
1761
1759
$ disabledCaches [] = $ cacheType ;
1762
1760
}
1763
1761
}
1764
-
1762
+
1765
1763
return $ disabledCaches ;
1766
1764
}
1767
1765
}
0 commit comments