|
28 | 28 | use Magento\Framework\Setup\InstallSchemaInterface; |
29 | 29 | use Magento\Framework\Setup\LoggerInterface; |
30 | 30 | use Magento\Framework\Setup\ModuleDataSetupInterface; |
31 | | -use Magento\Framework\Setup\PatchApplierInterface; |
| 31 | +use Magento\Framework\Setup\Patch\PatchApplier; |
| 32 | +use Magento\Framework\Setup\Patch\PatchApplierFactory; |
32 | 33 | use Magento\Framework\Setup\SchemaPersistor; |
33 | 34 | use Magento\Framework\Setup\SchemaSetupInterface; |
34 | 35 | use Magento\Framework\Setup\UpgradeDataInterface; |
35 | 36 | use Magento\Framework\Setup\UpgradeSchemaInterface; |
36 | 37 | use Magento\Setup\Console\Command\InstallCommand; |
37 | 38 | use Magento\Setup\Controller\ResponseTypeInterface; |
38 | 39 | use Magento\Setup\Model\ConfigModel as SetupConfigModel; |
39 | | -use Magento\Framework\Setup\Patch\PatchApplier; |
40 | | -use Magento\Framework\Setup\Patch\PatchApplierFactory; |
41 | 40 | use Magento\Setup\Module\ConnectionFactory; |
42 | 41 | use Magento\Setup\Module\DataSetupFactory; |
43 | 42 | use Magento\Setup\Module\SetupFactory; |
@@ -516,6 +515,7 @@ public function checkExtensions() |
516 | 515 | ) { |
517 | 516 | $errorMsg = "Missing following extensions: '" |
518 | 517 | . implode("' '", $phpExtensionsCheckResult['data']['missing']) . "'"; |
| 518 | + // phpcs:ignore Magento2.Exceptions.DirectThrow |
519 | 519 | throw new \Exception($errorMsg); |
520 | 520 | } |
521 | 521 | } |
@@ -900,6 +900,7 @@ private function throwExceptionForNotWritablePaths(array $paths) |
900 | 900 | { |
901 | 901 | if ($paths) { |
902 | 902 | $errorMsg = "Missing write permissions to the following paths:" . PHP_EOL . implode(PHP_EOL, $paths); |
| 903 | + // phpcs:ignore Magento2.Exceptions.DirectThrow |
903 | 904 | throw new \Exception($errorMsg); |
904 | 905 | } |
905 | 906 | } |
@@ -941,10 +942,12 @@ private function handleDBSchemaData($setup, $type, array $request) |
941 | 942 | if ($type === 'schema') { |
942 | 943 | $patchApplier = $this->patchApplierFactory->create(['schemaSetup' => $setup]); |
943 | 944 | } elseif ($type === 'data') { |
944 | | - $patchApplier = $this->patchApplierFactory->create([ |
945 | | - 'moduleDataSetup' => $setup, |
946 | | - 'objectManager' => $this->objectManagerProvider->get() |
947 | | - ]); |
| 945 | + $patchApplier = $this->patchApplierFactory->create( |
| 946 | + [ |
| 947 | + 'moduleDataSetup' => $setup, |
| 948 | + 'objectManager' => $this->objectManagerProvider->get() |
| 949 | + ] |
| 950 | + ); |
948 | 951 | } |
949 | 952 |
|
950 | 953 | foreach ($moduleNames as $moduleName) { |
@@ -1311,7 +1314,9 @@ public function cleanupDb() |
1311 | 1314 | //If for different shards one database was specified - no need to clean it few times |
1312 | 1315 | if (!in_array($dbName, $cleanedUpDatabases)) { |
1313 | 1316 | $this->log->log("Cleaning up database {$dbName}"); |
| 1317 | + // phpcs:ignore Magento2.SQL.RawQuery |
1314 | 1318 | $connection->query("DROP DATABASE IF EXISTS {$dbName}"); |
| 1319 | + // phpcs:ignore Magento2.SQL.RawQuery |
1315 | 1320 | $connection->query("CREATE DATABASE IF NOT EXISTS {$dbName}"); |
1316 | 1321 | $cleanedUpDatabases[] = $dbName; |
1317 | 1322 | } |
@@ -1511,18 +1516,22 @@ private function cleanupGeneratedFiles() |
1511 | 1516 | */ |
1512 | 1517 | private function isAdminDataSet($request) |
1513 | 1518 | { |
1514 | | - $adminData = array_filter($request, function ($value, $key) { |
1515 | | - return in_array( |
1516 | | - $key, |
1517 | | - [ |
1518 | | - AdminAccount::KEY_EMAIL, |
1519 | | - AdminAccount::KEY_FIRST_NAME, |
1520 | | - AdminAccount::KEY_LAST_NAME, |
1521 | | - AdminAccount::KEY_USER, |
1522 | | - AdminAccount::KEY_PASSWORD, |
1523 | | - ] |
1524 | | - ) && $value !== null; |
1525 | | - }, ARRAY_FILTER_USE_BOTH); |
| 1519 | + $adminData = array_filter( |
| 1520 | + $request, |
| 1521 | + function ($value, $key) { |
| 1522 | + return in_array( |
| 1523 | + $key, |
| 1524 | + [ |
| 1525 | + AdminAccount::KEY_EMAIL, |
| 1526 | + AdminAccount::KEY_FIRST_NAME, |
| 1527 | + AdminAccount::KEY_LAST_NAME, |
| 1528 | + AdminAccount::KEY_USER, |
| 1529 | + AdminAccount::KEY_PASSWORD, |
| 1530 | + ] |
| 1531 | + ) && $value !== null; |
| 1532 | + }, |
| 1533 | + ARRAY_FILTER_USE_BOTH |
| 1534 | + ); |
1526 | 1535 |
|
1527 | 1536 | return !empty($adminData); |
1528 | 1537 | } |
|
0 commit comments