diff --git a/app/code/Magento/Analytics/Setup/Patch/Data/PrepareInitialConfig.php b/app/code/Magento/Analytics/Setup/Patch/Data/PrepareInitialConfig.php index 40c914435cc1a..ef54e867f5b6e 100644 --- a/app/code/Magento/Analytics/Setup/Patch/Data/PrepareInitialConfig.php +++ b/app/code/Magento/Analytics/Setup/Patch/Data/PrepareInitialConfig.php @@ -8,6 +8,7 @@ use Magento\Analytics\Model\Config\Backend\Enabled\SubscriptionHandler; use Magento\Framework\App\ResourceConnection; +use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Setup\Model\Patch\DataPatchInterface; use Magento\Setup\Model\Patch\PatchVersionInterface; @@ -19,18 +20,18 @@ class PrepareInitialConfig implements DataPatchInterface, PatchVersionInterface { /** - * @var ResourceConnection + * @var ModuleDataSetupInterface */ - private $resourceConnection; + private $moduleDataSetup; /** * PrepareInitialConfig constructor. - * @param ResourceConnection $resourceConnection + * @param ModuleDataSetupInterface $moduleDataSetup */ public function __construct( - ResourceConnection $resourceConnection + ModuleDataSetupInterface $moduleDataSetup ) { - $this->resourceConnection = $resourceConnection; + $this->moduleDataSetup = $moduleDataSetup; } /** @@ -38,8 +39,8 @@ public function __construct( */ public function apply() { - $this->resourceConnection->getConnection()->insertMultiple( - $this->resourceConnection->getConnection()->getTableName('core_config_data'), + $this->moduleDataSetup->getConnection()->insertMultiple( + $this->moduleDataSetup->getConnection()->getTableName('core_config_data'), [ [ 'scope' => 'default', @@ -56,8 +57,8 @@ public function apply() ] ); - $this->resourceConnection->getConnection()->insert( - $this->resourceConnection->getConnection()->getTableName('flag'), + $this->moduleDataSetup->getConnection()->insert( + $this->moduleDataSetup->getConnection()->getTableName('flag'), [ 'flag_code' => SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE, 'state' => 0, @@ -78,7 +79,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Authorization/Setup/Patch/Data/InitializeAuthRoles.php b/app/code/Magento/Authorization/Setup/Patch/Data/InitializeAuthRoles.php index 8b37210981973..815499deed7e6 100644 --- a/app/code/Magento/Authorization/Setup/Patch/Data/InitializeAuthRoles.php +++ b/app/code/Magento/Authorization/Setup/Patch/Data/InitializeAuthRoles.php @@ -118,7 +118,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Braintree/Setup/Patch/Data/ConvertSerializedDataToJson.php b/app/code/Magento/Braintree/Setup/Patch/Data/ConvertSerializedDataToJson.php index 6d31663d6635b..ac53ec37e6f4e 100644 --- a/app/code/Magento/Braintree/Setup/Patch/Data/ConvertSerializedDataToJson.php +++ b/app/code/Magento/Braintree/Setup/Patch/Data/ConvertSerializedDataToJson.php @@ -95,7 +95,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Bundle/Setup/Patch/Data/ApplyAttributesUpdate.php b/app/code/Magento/Bundle/Setup/Patch/Data/ApplyAttributesUpdate.php index dd53c443f46b5..e7035c8636fde 100644 --- a/app/code/Magento/Bundle/Setup/Patch/Data/ApplyAttributesUpdate.php +++ b/app/code/Magento/Bundle/Setup/Patch/Data/ApplyAttributesUpdate.php @@ -224,7 +224,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedEntityTytpes.php b/app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedEntityTytpes.php index b0872fdff13c2..eb2ef7ce94749 100644 --- a/app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedEntityTytpes.php +++ b/app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedEntityTytpes.php @@ -188,7 +188,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.2'; } diff --git a/app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedSchema.php b/app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedSchema.php index 9863e7eb62904..5fb56ef01b3ba 100644 --- a/app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedSchema.php +++ b/app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedSchema.php @@ -147,7 +147,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.4'; } diff --git a/app/code/Magento/Catalog/Setup/Patch/Data/ChangePriceAttributeDefaultScope.php b/app/code/Magento/Catalog/Setup/Patch/Data/ChangePriceAttributeDefaultScope.php index 85d37126145b4..58d78a56c5bd2 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Data/ChangePriceAttributeDefaultScope.php +++ b/app/code/Magento/Catalog/Setup/Patch/Data/ChangePriceAttributeDefaultScope.php @@ -84,7 +84,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.1.3'; } diff --git a/app/code/Magento/Catalog/Setup/Patch/Data/DisallowUsingHtmlForProductName.php b/app/code/Magento/Catalog/Setup/Patch/Data/DisallowUsingHtmlForProductName.php index b80fd5cedda40..1228dcec5b765 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Data/DisallowUsingHtmlForProductName.php +++ b/app/code/Magento/Catalog/Setup/Patch/Data/DisallowUsingHtmlForProductName.php @@ -70,7 +70,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.1.5'; } diff --git a/app/code/Magento/Catalog/Setup/Patch/Data/InstallDefaultCategories.php b/app/code/Magento/Catalog/Setup/Patch/Data/InstallDefaultCategories.php index adaa421841de8..d9c748437498d 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Data/InstallDefaultCategories.php +++ b/app/code/Magento/Catalog/Setup/Patch/Data/InstallDefaultCategories.php @@ -352,7 +352,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Catalog/Setup/Patch/Data/RemoveGroupPrice.php b/app/code/Magento/Catalog/Setup/Patch/Data/RemoveGroupPrice.php index eb536eb1b0980..7359fd536bd52 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Data/RemoveGroupPrice.php +++ b/app/code/Magento/Catalog/Setup/Patch/Data/RemoveGroupPrice.php @@ -90,7 +90,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Catalog/Setup/Patch/Data/SetNewResourceModelsPaths.php b/app/code/Magento/Catalog/Setup/Patch/Data/SetNewResourceModelsPaths.php index 24913b3ca96ee..d7e2691d806d9 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Data/SetNewResourceModelsPaths.php +++ b/app/code/Magento/Catalog/Setup/Patch/Data/SetNewResourceModelsPaths.php @@ -101,7 +101,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.2'; } diff --git a/app/code/Magento/Catalog/Setup/Patch/Data/UpdateDefaultAttributeValue.php b/app/code/Magento/Catalog/Setup/Patch/Data/UpdateDefaultAttributeValue.php index ade3759159980..d4b21a25988e7 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Data/UpdateDefaultAttributeValue.php +++ b/app/code/Magento/Catalog/Setup/Patch/Data/UpdateDefaultAttributeValue.php @@ -65,7 +65,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.3'; } diff --git a/app/code/Magento/Catalog/Setup/Patch/Data/UpdateMediaAttributesBackendTypes.php b/app/code/Magento/Catalog/Setup/Patch/Data/UpdateMediaAttributesBackendTypes.php index 66fe776ec02e3..8de6a32293d14 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Data/UpdateMediaAttributesBackendTypes.php +++ b/app/code/Magento/Catalog/Setup/Patch/Data/UpdateMediaAttributesBackendTypes.php @@ -76,7 +76,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.4'; } diff --git a/app/code/Magento/Catalog/Setup/Patch/Data/UpdateProductAttributes.php b/app/code/Magento/Catalog/Setup/Patch/Data/UpdateProductAttributes.php index 14f9e324cc933..9a95c45b59db0 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Data/UpdateProductAttributes.php +++ b/app/code/Magento/Catalog/Setup/Patch/Data/UpdateProductAttributes.php @@ -248,7 +248,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.5'; } diff --git a/app/code/Magento/Catalog/Setup/Patch/Data/UpdateProductMetaDescription.php b/app/code/Magento/Catalog/Setup/Patch/Data/UpdateProductMetaDescription.php index 256b4c3330a29..83c7393089fa2 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Data/UpdateProductMetaDescription.php +++ b/app/code/Magento/Catalog/Setup/Patch/Data/UpdateProductMetaDescription.php @@ -72,7 +72,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.7'; } diff --git a/app/code/Magento/Catalog/Setup/Patch/Data/UpgradeWebsiteAttributes.php b/app/code/Magento/Catalog/Setup/Patch/Data/UpgradeWebsiteAttributes.php index 24f9a16624bf1..516c219204839 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Data/UpgradeWebsiteAttributes.php +++ b/app/code/Magento/Catalog/Setup/Patch/Data/UpgradeWebsiteAttributes.php @@ -404,7 +404,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.2.2'; } diff --git a/app/code/Magento/Catalog/Setup/Patch/Data/UpgradeWidgetData.php b/app/code/Magento/Catalog/Setup/Patch/Data/UpgradeWidgetData.php index e563ff480fced..3ad2b9f96f5b0 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Data/UpgradeWidgetData.php +++ b/app/code/Magento/Catalog/Setup/Patch/Data/UpgradeWidgetData.php @@ -148,7 +148,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.2.1'; } diff --git a/app/code/Magento/CatalogInventory/Setup/Patch/Data/ConvertSerializedDataToJson.php b/app/code/Magento/CatalogInventory/Setup/Patch/Data/ConvertSerializedDataToJson.php index 5f8a6338efc4f..c78bfad696f23 100644 --- a/app/code/Magento/CatalogInventory/Setup/Patch/Data/ConvertSerializedDataToJson.php +++ b/app/code/Magento/CatalogInventory/Setup/Patch/Data/ConvertSerializedDataToJson.php @@ -111,7 +111,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.2.1'; } diff --git a/app/code/Magento/CatalogInventory/Setup/Patch/Data/CreateDefaultStock.php b/app/code/Magento/CatalogInventory/Setup/Patch/Data/CreateDefaultStock.php index e25f521224e5a..a5b5e984d5078 100644 --- a/app/code/Magento/CatalogInventory/Setup/Patch/Data/CreateDefaultStock.php +++ b/app/code/Magento/CatalogInventory/Setup/Patch/Data/CreateDefaultStock.php @@ -76,7 +76,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/CatalogInventory/Setup/Patch/Data/UpdateStockItemsWebsite.php b/app/code/Magento/CatalogInventory/Setup/Patch/Data/UpdateStockItemsWebsite.php index 0eef39c798ce8..58bbb4e977d55 100644 --- a/app/code/Magento/CatalogInventory/Setup/Patch/Data/UpdateStockItemsWebsite.php +++ b/app/code/Magento/CatalogInventory/Setup/Patch/Data/UpdateStockItemsWebsite.php @@ -80,7 +80,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.2.0'; } diff --git a/app/code/Magento/CatalogRule/Setup/Patch/Data/ConvertSerializedDataToJson.php b/app/code/Magento/CatalogRule/Setup/Patch/Data/ConvertSerializedDataToJson.php index d87f39f4ee937..bd3970232feef 100644 --- a/app/code/Magento/CatalogRule/Setup/Patch/Data/ConvertSerializedDataToJson.php +++ b/app/code/Magento/CatalogRule/Setup/Patch/Data/ConvertSerializedDataToJson.php @@ -87,7 +87,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.3'; } diff --git a/app/code/Magento/CatalogRule/Setup/Patch/Data/UpdateClassAliasesForCatalogRules.php b/app/code/Magento/CatalogRule/Setup/Patch/Data/UpdateClassAliasesForCatalogRules.php index ffac469dc764c..17920a997014f 100644 --- a/app/code/Magento/CatalogRule/Setup/Patch/Data/UpdateClassAliasesForCatalogRules.php +++ b/app/code/Magento/CatalogRule/Setup/Patch/Data/UpdateClassAliasesForCatalogRules.php @@ -65,7 +65,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/CatalogSearch/Setup/Patch/Data/SetInitialSearchWeightForAttributes.php b/app/code/Magento/CatalogSearch/Setup/Patch/Data/SetInitialSearchWeightForAttributes.php index c61c8931c2eab..ba2ea2cf43eb1 100644 --- a/app/code/Magento/CatalogSearch/Setup/Patch/Data/SetInitialSearchWeightForAttributes.php +++ b/app/code/Magento/CatalogSearch/Setup/Patch/Data/SetInitialSearchWeightForAttributes.php @@ -62,7 +62,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/CreateUrlAttributes.php b/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/CreateUrlAttributes.php index 23b6322ccfaf6..0225f4b90b22a 100644 --- a/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/CreateUrlAttributes.php +++ b/app/code/Magento/CatalogUrlRewrite/Setup/Patch/Data/CreateUrlAttributes.php @@ -115,7 +115,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Checkout/Setup/Patch/Data/PrepareInitialCheckoutConfiguration.php b/app/code/Magento/Checkout/Setup/Patch/Data/PrepareInitialCheckoutConfiguration.php index 2f308e164ad9e..a10484a092d83 100644 --- a/app/code/Magento/Checkout/Setup/Patch/Data/PrepareInitialCheckoutConfiguration.php +++ b/app/code/Magento/Checkout/Setup/Patch/Data/PrepareInitialCheckoutConfiguration.php @@ -835,7 +835,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Cms/Setup/Patch/Data/ConvertWidgetConditionsToJson.php b/app/code/Magento/Cms/Setup/Patch/Data/ConvertWidgetConditionsToJson.php index 894fc9b3b1e76..0b055c20059f2 100644 --- a/app/code/Magento/Cms/Setup/Patch/Data/ConvertWidgetConditionsToJson.php +++ b/app/code/Magento/Cms/Setup/Patch/Data/ConvertWidgetConditionsToJson.php @@ -143,7 +143,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.2'; } diff --git a/app/code/Magento/Cms/Setup/Patch/Data/CreateDefaultPages.php b/app/code/Magento/Cms/Setup/Patch/Data/CreateDefaultPages.php index aca7d6de53a9f..47194a2871775 100644 --- a/app/code/Magento/Cms/Setup/Patch/Data/CreateDefaultPages.php +++ b/app/code/Magento/Cms/Setup/Patch/Data/CreateDefaultPages.php @@ -385,7 +385,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Cms/Setup/Patch/Data/UpdatePrivacyPolicyPage.php b/app/code/Magento/Cms/Setup/Patch/Data/UpdatePrivacyPolicyPage.php index 01ab60c420346..d5dbc0be4f7c6 100644 --- a/app/code/Magento/Cms/Setup/Patch/Data/UpdatePrivacyPolicyPage.php +++ b/app/code/Magento/Cms/Setup/Patch/Data/UpdatePrivacyPolicyPage.php @@ -244,7 +244,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Config/Setup/Patch/Data/UpdateClassAliases.php b/app/code/Magento/Config/Setup/Patch/Data/UpdateClassAliases.php index 2e42f20d360f6..22d2977467329 100644 --- a/app/code/Magento/Config/Setup/Patch/Data/UpdateClassAliases.php +++ b/app/code/Magento/Config/Setup/Patch/Data/UpdateClassAliases.php @@ -61,7 +61,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/InstallInitialConfigurableAttributes.php b/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/InstallInitialConfigurableAttributes.php index 130ff34cee780..373f0ba4b0a48 100644 --- a/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/InstallInitialConfigurableAttributes.php +++ b/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/InstallInitialConfigurableAttributes.php @@ -89,7 +89,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/UpdateTierPriceAttribute.php b/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/UpdateTierPriceAttribute.php index 363eb6158643c..1ba493cd3fa52 100644 --- a/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/UpdateTierPriceAttribute.php +++ b/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/UpdateTierPriceAttribute.php @@ -79,7 +79,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.2.0'; } diff --git a/app/code/Magento/CurrencySymbol/Setup/Patch/Data/ConvertSerializedCustomCurrencySymbolToJson.php b/app/code/Magento/CurrencySymbol/Setup/Patch/Data/ConvertSerializedCustomCurrencySymbolToJson.php index b414940523601..2258833e20362 100644 --- a/app/code/Magento/CurrencySymbol/Setup/Patch/Data/ConvertSerializedCustomCurrencySymbolToJson.php +++ b/app/code/Magento/CurrencySymbol/Setup/Patch/Data/ConvertSerializedCustomCurrencySymbolToJson.php @@ -85,7 +85,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/AddCustomerUpdatedAtAttribute.php b/app/code/Magento/Customer/Setup/Patch/Data/AddCustomerUpdatedAtAttribute.php index b86524ba653c3..05710cdb6cb29 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/AddCustomerUpdatedAtAttribute.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/AddCustomerUpdatedAtAttribute.php @@ -75,7 +75,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.4'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/AddNonSpecifiedGenderAttributeOption.php b/app/code/Magento/Customer/Setup/Patch/Data/AddNonSpecifiedGenderAttributeOption.php index 0fa72b66df69e..fbe1c85515664 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/AddNonSpecifiedGenderAttributeOption.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/AddNonSpecifiedGenderAttributeOption.php @@ -79,7 +79,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.2'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/AddSecurityTrackingAttributes.php b/app/code/Magento/Customer/Setup/Patch/Data/AddSecurityTrackingAttributes.php index 1892529bcbb01..4867b19ce523e 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/AddSecurityTrackingAttributes.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/AddSecurityTrackingAttributes.php @@ -110,7 +110,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.7'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/ConvertValidationRulesFromSerializedToJson.php b/app/code/Magento/Customer/Setup/Patch/Data/ConvertValidationRulesFromSerializedToJson.php index 04cc390611d0a..915c7ec59688b 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/ConvertValidationRulesFromSerializedToJson.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/ConvertValidationRulesFromSerializedToJson.php @@ -68,7 +68,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.11'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/DefaultCustomerGroupsAndAttributes.php b/app/code/Magento/Customer/Setup/Patch/Data/DefaultCustomerGroupsAndAttributes.php index f3b4d8cb1c8bb..cd5e8429cef35 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/DefaultCustomerGroupsAndAttributes.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/DefaultCustomerGroupsAndAttributes.php @@ -166,7 +166,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/MigrateStoresAllowedCountriesToWebsite.php b/app/code/Magento/Customer/Setup/Patch/Data/MigrateStoresAllowedCountriesToWebsite.php index 27da749e7b27b..fe1dcfab4881e 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/MigrateStoresAllowedCountriesToWebsite.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/MigrateStoresAllowedCountriesToWebsite.php @@ -26,7 +26,7 @@ class MigrateStoresAllowedCountriesToWebsite implements DataPatchInterface, Patc private $storeManager; /** - * @var AllowedCountries + * @var AllowedCountriesFactory */ private $allowedCountries; @@ -34,12 +34,12 @@ class MigrateStoresAllowedCountriesToWebsite implements DataPatchInterface, Patc * MigrateStoresAllowedCountriesToWebsite constructor. * @param ResourceConnection $resourceConnection * @param StoreManagerInterface $storeManager - * @param AllowedCountries $allowedCountries + * @param AllowedCountriesFactory $allowedCountries */ public function __construct( ResourceConnection $resourceConnection, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Directory\Model\AllowedCountries $allowedCountries + \Magento\Directory\Model\AllowedCountriesFactory $allowedCountries ) { $this->resourceConnection = $resourceConnection; $this->storeManager = $storeManager; @@ -161,7 +161,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.9'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/RemoveCheckoutRegisterAndUpdateAttributes.php b/app/code/Magento/Customer/Setup/Patch/Data/RemoveCheckoutRegisterAndUpdateAttributes.php index a668adf84f814..d05b1c690f5af 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/RemoveCheckoutRegisterAndUpdateAttributes.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/RemoveCheckoutRegisterAndUpdateAttributes.php @@ -121,7 +121,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.6'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/UpdateAutocompleteOnStorefrontConfigPath.php b/app/code/Magento/Customer/Setup/Patch/Data/UpdateAutocompleteOnStorefrontConfigPath.php index 191c7ddeeabae..6bf140c173996 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/UpdateAutocompleteOnStorefrontConfigPath.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/UpdateAutocompleteOnStorefrontConfigPath.php @@ -56,7 +56,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.8'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/UpdateCustomerAttributeInputFilters.php b/app/code/Magento/Customer/Setup/Patch/Data/UpdateCustomerAttributeInputFilters.php index d6e2b09481aca..98db8250ed298 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/UpdateCustomerAttributeInputFilters.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/UpdateCustomerAttributeInputFilters.php @@ -86,7 +86,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.13'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/UpdateCustomerAttributesMetadata.php b/app/code/Magento/Customer/Setup/Patch/Data/UpdateCustomerAttributesMetadata.php index 1ac2488989565..ee67ee6ea13de 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/UpdateCustomerAttributesMetadata.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/UpdateCustomerAttributesMetadata.php @@ -187,7 +187,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/UpdateIdentifierCustomerAttributesVisibility.php b/app/code/Magento/Customer/Setup/Patch/Data/UpdateIdentifierCustomerAttributesVisibility.php index 64652b50a6482..7e4ed05e25cd6 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/UpdateIdentifierCustomerAttributesVisibility.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/UpdateIdentifierCustomerAttributesVisibility.php @@ -84,7 +84,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.3'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/UpdateVATNumber.php b/app/code/Magento/Customer/Setup/Patch/Data/UpdateVATNumber.php index 78446bac49863..5f8da8b3f2c88 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/UpdateVATNumber.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/UpdateVATNumber.php @@ -71,7 +71,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.12'; } diff --git a/app/code/Magento/Customer/Setup/Patch/Data/UpgradePasswordHashAndAddress.php b/app/code/Magento/Customer/Setup/Patch/Data/UpgradePasswordHashAndAddress.php index 7d9f3f8375bed..203ecff894858 100644 --- a/app/code/Magento/Customer/Setup/Patch/Data/UpgradePasswordHashAndAddress.php +++ b/app/code/Magento/Customer/Setup/Patch/Data/UpgradePasswordHashAndAddress.php @@ -105,7 +105,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.5'; } diff --git a/app/code/Magento/Dhl/Setup/Patch/Data/PrepareShipmentDays.php b/app/code/Magento/Dhl/Setup/Patch/Data/PrepareShipmentDays.php index 712e2d55e44d0..5c76cb79d4140 100644 --- a/app/code/Magento/Dhl/Setup/Patch/Data/PrepareShipmentDays.php +++ b/app/code/Magento/Dhl/Setup/Patch/Data/PrepareShipmentDays.php @@ -83,7 +83,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForCroatia.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForCroatia.php index 045c1c75a37d0..8ee38e8584d14 100644 --- a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForCroatia.php +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForCroatia.php @@ -99,7 +99,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForIndia.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForIndia.php index b82f1c01bcad4..4455955e982c8 100644 --- a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForIndia.php +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForIndia.php @@ -114,7 +114,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.2'; } diff --git a/app/code/Magento/Directory/Setup/Patch/Data/InitializeDirectoryData.php b/app/code/Magento/Directory/Setup/Patch/Data/InitializeDirectoryData.php index 3e2ae51bf9bd2..de76c4f14c209 100644 --- a/app/code/Magento/Directory/Setup/Patch/Data/InitializeDirectoryData.php +++ b/app/code/Magento/Directory/Setup/Patch/Data/InitializeDirectoryData.php @@ -883,7 +883,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Downloadable/Setup/Patch/Data/PatchInitial.php b/app/code/Magento/Downloadable/Setup/Patch/Data/PatchInitial.php index f79786b87fd1c..bacd9b7d38e1e 100644 --- a/app/code/Magento/Downloadable/Setup/Patch/Data/PatchInitial.php +++ b/app/code/Magento/Downloadable/Setup/Patch/Data/PatchInitial.php @@ -189,7 +189,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Eav/Setup/Patch/Data/InitializeAttributeModels.php b/app/code/Magento/Eav/Setup/Patch/Data/InitializeAttributeModels.php index 6d03852a96115..f8ad98e1e5dad 100644 --- a/app/code/Magento/Eav/Setup/Patch/Data/InitializeAttributeModels.php +++ b/app/code/Magento/Eav/Setup/Patch/Data/InitializeAttributeModels.php @@ -137,7 +137,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Fedex/Setup/Patch/Data/ConfigureFedexDefaults.php b/app/code/Magento/Fedex/Setup/Patch/Data/ConfigureFedexDefaults.php index 8489b1f8ce724..5e148c8d0cb21 100644 --- a/app/code/Magento/Fedex/Setup/Patch/Data/ConfigureFedexDefaults.php +++ b/app/code/Magento/Fedex/Setup/Patch/Data/ConfigureFedexDefaults.php @@ -125,7 +125,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/GiftMessage/Setup/Patch/Data/AddGiftMessageAttributes.php b/app/code/Magento/GiftMessage/Setup/Patch/Data/AddGiftMessageAttributes.php index b0c83212a99fd..3bdcf11fd4c4c 100644 --- a/app/code/Magento/GiftMessage/Setup/Patch/Data/AddGiftMessageAttributes.php +++ b/app/code/Magento/GiftMessage/Setup/Patch/Data/AddGiftMessageAttributes.php @@ -130,7 +130,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/GiftMessage/Setup/Patch/Data/MoveGiftMessageToGiftOptionsGroup.php b/app/code/Magento/GiftMessage/Setup/Patch/Data/MoveGiftMessageToGiftOptionsGroup.php index 1ca4bb694c07d..52468f1a87dad 100644 --- a/app/code/Magento/GiftMessage/Setup/Patch/Data/MoveGiftMessageToGiftOptionsGroup.php +++ b/app/code/Magento/GiftMessage/Setup/Patch/Data/MoveGiftMessageToGiftOptionsGroup.php @@ -81,7 +81,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/GiftMessage/Setup/Patch/Data/UpdateGiftMessageAttribute.php b/app/code/Magento/GiftMessage/Setup/Patch/Data/UpdateGiftMessageAttribute.php index c7e24dbd272b2..5bf8debfb1cc4 100644 --- a/app/code/Magento/GiftMessage/Setup/Patch/Data/UpdateGiftMessageAttribute.php +++ b/app/code/Magento/GiftMessage/Setup/Patch/Data/UpdateGiftMessageAttribute.php @@ -74,7 +74,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.1.0'; } diff --git a/app/code/Magento/GroupedProduct/Setup/Patch/Data/InitializeGroupedProductLinks.php b/app/code/Magento/GroupedProduct/Setup/Patch/Data/InitializeGroupedProductLinks.php index ad98553c84886..ea23b2d40d067 100644 --- a/app/code/Magento/GroupedProduct/Setup/Patch/Data/InitializeGroupedProductLinks.php +++ b/app/code/Magento/GroupedProduct/Setup/Patch/Data/InitializeGroupedProductLinks.php @@ -111,7 +111,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/GroupedProduct/Setup/Patch/Data/UpdateProductRelations.php b/app/code/Magento/GroupedProduct/Setup/Patch/Data/UpdateProductRelations.php index 6e00b0e174e22..dd174a3006721 100644 --- a/app/code/Magento/GroupedProduct/Setup/Patch/Data/UpdateProductRelations.php +++ b/app/code/Magento/GroupedProduct/Setup/Patch/Data/UpdateProductRelations.php @@ -81,7 +81,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Indexer/Setup/Patch/Data/InitializeIndexerState.php b/app/code/Magento/Indexer/Setup/Patch/Data/InitializeIndexerState.php index dd1b9e628848c..f9a6673aedb27 100644 --- a/app/code/Magento/Indexer/Setup/Patch/Data/InitializeIndexerState.php +++ b/app/code/Magento/Indexer/Setup/Patch/Data/InitializeIndexerState.php @@ -114,7 +114,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.1.0'; } diff --git a/app/code/Magento/Integration/Setup/Patch/Data/RemoveInactiveTokens.php b/app/code/Magento/Integration/Setup/Patch/Data/RemoveInactiveTokens.php index b6ff3d27a994c..c4c619745d955 100644 --- a/app/code/Magento/Integration/Setup/Patch/Data/RemoveInactiveTokens.php +++ b/app/code/Magento/Integration/Setup/Patch/Data/RemoveInactiveTokens.php @@ -57,7 +57,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.2.0'; } diff --git a/app/code/Magento/Msrp/Setup/Patch/Data/ChangePriceAttributeDefaultScope.php b/app/code/Magento/Msrp/Setup/Patch/Data/ChangePriceAttributeDefaultScope.php index 50c3a296343d0..0db138f2582b6 100644 --- a/app/code/Magento/Msrp/Setup/Patch/Data/ChangePriceAttributeDefaultScope.php +++ b/app/code/Magento/Msrp/Setup/Patch/Data/ChangePriceAttributeDefaultScope.php @@ -64,7 +64,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.1.3'; } diff --git a/app/code/Magento/Msrp/Setup/Patch/Data/InitializeMsrpAttributes.php b/app/code/Magento/Msrp/Setup/Patch/Data/InitializeMsrpAttributes.php index 9b35df28e3c0d..63c3989982a48 100644 --- a/app/code/Magento/Msrp/Setup/Patch/Data/InitializeMsrpAttributes.php +++ b/app/code/Magento/Msrp/Setup/Patch/Data/InitializeMsrpAttributes.php @@ -115,7 +115,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/OfflineShipping/Setup/Patch/Data/UpdateQuoteShippingAddresses.php b/app/code/Magento/OfflineShipping/Setup/Patch/Data/UpdateQuoteShippingAddresses.php index 088daac9366ba..428e98059bbb4 100644 --- a/app/code/Magento/OfflineShipping/Setup/Patch/Data/UpdateQuoteShippingAddresses.php +++ b/app/code/Magento/OfflineShipping/Setup/Patch/Data/UpdateQuoteShippingAddresses.php @@ -80,7 +80,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Paypal/Setup/Patch/Data/AddPaypalOrderStatuses.php b/app/code/Magento/Paypal/Setup/Patch/Data/AddPaypalOrderStatuses.php index 7f605d862be8b..9217737c5c9cc 100644 --- a/app/code/Magento/Paypal/Setup/Patch/Data/AddPaypalOrderStatuses.php +++ b/app/code/Magento/Paypal/Setup/Patch/Data/AddPaypalOrderStatuses.php @@ -106,7 +106,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Quote/Setup/Patch/Data/ConvertSerializedDataToJson.php b/app/code/Magento/Quote/Setup/Patch/Data/ConvertSerializedDataToJson.php index 1c317c864313b..17eac0fe2e192 100644 --- a/app/code/Magento/Quote/Setup/Patch/Data/ConvertSerializedDataToJson.php +++ b/app/code/Magento/Quote/Setup/Patch/Data/ConvertSerializedDataToJson.php @@ -69,7 +69,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.6'; } diff --git a/app/code/Magento/Quote/Setup/Patch/Data/InstallEntityTypes.php b/app/code/Magento/Quote/Setup/Patch/Data/InstallEntityTypes.php index db1d756674e77..6ae540c509333 100644 --- a/app/code/Magento/Quote/Setup/Patch/Data/InstallEntityTypes.php +++ b/app/code/Magento/Quote/Setup/Patch/Data/InstallEntityTypes.php @@ -79,7 +79,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Reports/Setup/Patch/Data/InitializeReportEntityTypesAndPages.php b/app/code/Magento/Reports/Setup/Patch/Data/InitializeReportEntityTypesAndPages.php index cc7afcd3726aa..fbf0700e3b044 100644 --- a/app/code/Magento/Reports/Setup/Patch/Data/InitializeReportEntityTypesAndPages.php +++ b/app/code/Magento/Reports/Setup/Patch/Data/InitializeReportEntityTypesAndPages.php @@ -108,7 +108,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Review/Setup/Patch/Data/InitReviewStatusesAndData.php b/app/code/Magento/Review/Setup/Patch/Data/InitReviewStatusesAndData.php index ed7df8eea8021..eba4f5c4687fa 100644 --- a/app/code/Magento/Review/Setup/Patch/Data/InitReviewStatusesAndData.php +++ b/app/code/Magento/Review/Setup/Patch/Data/InitReviewStatusesAndData.php @@ -109,7 +109,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Sales/Setup/Patch/Data/ConvertSerializedDataToJson.php b/app/code/Magento/Sales/Setup/Patch/Data/ConvertSerializedDataToJson.php index 924a2a9af004f..cff719514a733 100644 --- a/app/code/Magento/Sales/Setup/Patch/Data/ConvertSerializedDataToJson.php +++ b/app/code/Magento/Sales/Setup/Patch/Data/ConvertSerializedDataToJson.php @@ -89,7 +89,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.6'; } diff --git a/app/code/Magento/Sales/Setup/Patch/Data/FillQuoteAddressIdInSalesOrderAddress.php b/app/code/Magento/Sales/Setup/Patch/Data/FillQuoteAddressIdInSalesOrderAddress.php index fa5900b2f6141..d4ac50ac7ef8d 100644 --- a/app/code/Magento/Sales/Setup/Patch/Data/FillQuoteAddressIdInSalesOrderAddress.php +++ b/app/code/Magento/Sales/Setup/Patch/Data/FillQuoteAddressIdInSalesOrderAddress.php @@ -130,7 +130,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.8'; } diff --git a/app/code/Magento/Sales/Setup/Patch/Data/InstallOrderStatusesAndInitialSalesConfig.php b/app/code/Magento/Sales/Setup/Patch/Data/InstallOrderStatusesAndInitialSalesConfig.php index ccb16ecb3c9fe..f898823a5ab16 100644 --- a/app/code/Magento/Sales/Setup/Patch/Data/InstallOrderStatusesAndInitialSalesConfig.php +++ b/app/code/Magento/Sales/Setup/Patch/Data/InstallOrderStatusesAndInitialSalesConfig.php @@ -168,7 +168,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Sales/Setup/Patch/Data/UpdateEntityTypeModelForInvoice.php b/app/code/Magento/Sales/Setup/Patch/Data/UpdateEntityTypeModelForInvoice.php index 7f42bf9401fa0..d6c9e7092aeff 100644 --- a/app/code/Magento/Sales/Setup/Patch/Data/UpdateEntityTypeModelForInvoice.php +++ b/app/code/Magento/Sales/Setup/Patch/Data/UpdateEntityTypeModelForInvoice.php @@ -71,7 +71,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.9'; } diff --git a/app/code/Magento/Sales/Setup/Patch/Data/UpdateEntityTypes.php b/app/code/Magento/Sales/Setup/Patch/Data/UpdateEntityTypes.php index 8ff4e34760120..0ab8086c33b3e 100644 --- a/app/code/Magento/Sales/Setup/Patch/Data/UpdateEntityTypes.php +++ b/app/code/Magento/Sales/Setup/Patch/Data/UpdateEntityTypes.php @@ -66,7 +66,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/SalesRule/Setup/Patch/Data/ConvertSerializedDataToJson.php b/app/code/Magento/SalesRule/Setup/Patch/Data/ConvertSerializedDataToJson.php index 2adf2fadaea2d..e0411743e473d 100644 --- a/app/code/Magento/SalesRule/Setup/Patch/Data/ConvertSerializedDataToJson.php +++ b/app/code/Magento/SalesRule/Setup/Patch/Data/ConvertSerializedDataToJson.php @@ -71,7 +71,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.2'; } diff --git a/app/code/Magento/SalesRule/Setup/Patch/Data/FillSalesRuleProductAttributeTable.php b/app/code/Magento/SalesRule/Setup/Patch/Data/FillSalesRuleProductAttributeTable.php index 34322cf5273bf..3129032bbef89 100644 --- a/app/code/Magento/SalesRule/Setup/Patch/Data/FillSalesRuleProductAttributeTable.php +++ b/app/code/Magento/SalesRule/Setup/Patch/Data/FillSalesRuleProductAttributeTable.php @@ -115,7 +115,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.3'; } diff --git a/app/code/Magento/SalesRule/Setup/Patch/Data/PrepareRuleModelSerializedData.php b/app/code/Magento/SalesRule/Setup/Patch/Data/PrepareRuleModelSerializedData.php index 49f83da45f715..73083e4235bf4 100644 --- a/app/code/Magento/SalesRule/Setup/Patch/Data/PrepareRuleModelSerializedData.php +++ b/app/code/Magento/SalesRule/Setup/Patch/Data/PrepareRuleModelSerializedData.php @@ -76,7 +76,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/SalesSequence/Setup/Patch/Data/CreateSequence.php b/app/code/Magento/SalesSequence/Setup/Patch/Data/CreateSequence.php index 91138e8515c66..016942c7d912d 100644 --- a/app/code/Magento/SalesSequence/Setup/Patch/Data/CreateSequence.php +++ b/app/code/Magento/SalesSequence/Setup/Patch/Data/CreateSequence.php @@ -59,7 +59,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/SampleData/Setup/Patch/Data/ClearSampleDataState.php b/app/code/Magento/SampleData/Setup/Patch/Data/ClearSampleDataState.php index 454c3971b065d..1a644c1b17471 100644 --- a/app/code/Magento/SampleData/Setup/Patch/Data/ClearSampleDataState.php +++ b/app/code/Magento/SampleData/Setup/Patch/Data/ClearSampleDataState.php @@ -59,7 +59,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Store/Setup/Patch/Data/UpdateStoreGroupCodes.php b/app/code/Magento/Store/Setup/Patch/Data/UpdateStoreGroupCodes.php index 8e5b36c2d9569..67af7f5d140d3 100644 --- a/app/code/Magento/Store/Setup/Patch/Data/UpdateStoreGroupCodes.php +++ b/app/code/Magento/Store/Setup/Patch/Data/UpdateStoreGroupCodes.php @@ -89,7 +89,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.1.0'; } diff --git a/app/code/Magento/Swatches/Setup/Patch/Data/AddSwatchImageAttribute.php b/app/code/Magento/Swatches/Setup/Patch/Data/AddSwatchImageAttribute.php index e77e7ee5b5692..e921af842d748 100644 --- a/app/code/Magento/Swatches/Setup/Patch/Data/AddSwatchImageAttribute.php +++ b/app/code/Magento/Swatches/Setup/Patch/Data/AddSwatchImageAttribute.php @@ -77,7 +77,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Swatches/Setup/Patch/Data/AddSwatchImageToDefaultAttribtueSet.php b/app/code/Magento/Swatches/Setup/Patch/Data/AddSwatchImageToDefaultAttribtueSet.php index df41d15850927..7c39e65de2614 100644 --- a/app/code/Magento/Swatches/Setup/Patch/Data/AddSwatchImageToDefaultAttribtueSet.php +++ b/app/code/Magento/Swatches/Setup/Patch/Data/AddSwatchImageToDefaultAttribtueSet.php @@ -74,7 +74,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Swatches/Setup/Patch/Data/ConvertAdditionalDataToJson.php b/app/code/Magento/Swatches/Setup/Patch/Data/ConvertAdditionalDataToJson.php index b35e3216f140a..4bba72ada964a 100644 --- a/app/code/Magento/Swatches/Setup/Patch/Data/ConvertAdditionalDataToJson.php +++ b/app/code/Magento/Swatches/Setup/Patch/Data/ConvertAdditionalDataToJson.php @@ -65,7 +65,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.3'; } diff --git a/app/code/Magento/Swatches/Setup/Patch/Data/UpdateAdminTextSwatchValues.php b/app/code/Magento/Swatches/Setup/Patch/Data/UpdateAdminTextSwatchValues.php index 076eeeb7e72e9..e50b52b251dca 100644 --- a/app/code/Magento/Swatches/Setup/Patch/Data/UpdateAdminTextSwatchValues.php +++ b/app/code/Magento/Swatches/Setup/Patch/Data/UpdateAdminTextSwatchValues.php @@ -58,7 +58,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.2'; } diff --git a/app/code/Magento/Tax/Setup/Patch/Data/AddTacAttributeAndTaxClasses.php b/app/code/Magento/Tax/Setup/Patch/Data/AddTacAttributeAndTaxClasses.php index 59361656156c6..ce007d8badd69 100644 --- a/app/code/Magento/Tax/Setup/Patch/Data/AddTacAttributeAndTaxClasses.php +++ b/app/code/Magento/Tax/Setup/Patch/Data/AddTacAttributeAndTaxClasses.php @@ -155,7 +155,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Tax/Setup/Patch/Data/UpdateTaxClassAttributeVisibility.php b/app/code/Magento/Tax/Setup/Patch/Data/UpdateTaxClassAttributeVisibility.php index 6f9fb6145cd26..afbfd8206bad7 100644 --- a/app/code/Magento/Tax/Setup/Patch/Data/UpdateTaxClassAttributeVisibility.php +++ b/app/code/Magento/Tax/Setup/Patch/Data/UpdateTaxClassAttributeVisibility.php @@ -74,7 +74,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Tax/Setup/Patch/Data/UpdateTaxRegionId.php b/app/code/Magento/Tax/Setup/Patch/Data/UpdateTaxRegionId.php index 6b5161d23b742..c673eb900dc49 100644 --- a/app/code/Magento/Tax/Setup/Patch/Data/UpdateTaxRegionId.php +++ b/app/code/Magento/Tax/Setup/Patch/Data/UpdateTaxRegionId.php @@ -94,7 +94,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.3'; } diff --git a/app/code/Magento/Theme/Setup/Patch/Data/ConvertSerializedData.php b/app/code/Magento/Theme/Setup/Patch/Data/ConvertSerializedData.php index b21d924333be3..39d594a0b08d7 100644 --- a/app/code/Magento/Theme/Setup/Patch/Data/ConvertSerializedData.php +++ b/app/code/Magento/Theme/Setup/Patch/Data/ConvertSerializedData.php @@ -73,7 +73,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.2'; } diff --git a/app/code/Magento/Theme/Setup/Patch/Data/RegisterThemes.php b/app/code/Magento/Theme/Setup/Patch/Data/RegisterThemes.php index 7766a44760d43..16eae035551d5 100644 --- a/app/code/Magento/Theme/Setup/Patch/Data/RegisterThemes.php +++ b/app/code/Magento/Theme/Setup/Patch/Data/RegisterThemes.php @@ -58,7 +58,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/UrlRewrite/Setup/Patch/Data/ConvertSerializedDataToJson.php b/app/code/Magento/UrlRewrite/Setup/Patch/Data/ConvertSerializedDataToJson.php index f869b0c891292..55ac11340fe45 100644 --- a/app/code/Magento/UrlRewrite/Setup/Patch/Data/ConvertSerializedDataToJson.php +++ b/app/code/Magento/UrlRewrite/Setup/Patch/Data/ConvertSerializedDataToJson.php @@ -62,7 +62,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/User/Setup/Patch/Data/UpgradePasswordHashes.php b/app/code/Magento/User/Setup/Patch/Data/UpgradePasswordHashes.php index 2842d79acc0c2..158f1c99748b4 100644 --- a/app/code/Magento/User/Setup/Patch/Data/UpgradePasswordHashes.php +++ b/app/code/Magento/User/Setup/Patch/Data/UpgradePasswordHashes.php @@ -53,7 +53,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/User/Setup/Patch/Data/UpgradeSerializedFields.php b/app/code/Magento/User/Setup/Patch/Data/UpgradeSerializedFields.php index a4776673f664e..fdd772cbdcc38 100644 --- a/app/code/Magento/User/Setup/Patch/Data/UpgradeSerializedFields.php +++ b/app/code/Magento/User/Setup/Patch/Data/UpgradeSerializedFields.php @@ -64,7 +64,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.2'; } diff --git a/app/code/Magento/Usps/Setup/Patch/Data/UpdateAllowedMethods.php b/app/code/Magento/Usps/Setup/Patch/Data/UpdateAllowedMethods.php index 2bdba1ff2f1e4..7840a4e087cc9 100644 --- a/app/code/Magento/Usps/Setup/Patch/Data/UpdateAllowedMethods.php +++ b/app/code/Magento/Usps/Setup/Patch/Data/UpdateAllowedMethods.php @@ -126,7 +126,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Vault/Setup/Patch/Data/SetCreditCardAsDefaultTokenType.php b/app/code/Magento/Vault/Setup/Patch/Data/SetCreditCardAsDefaultTokenType.php index 1308c64bbfbe6..6f6e55a689a07 100644 --- a/app/code/Magento/Vault/Setup/Patch/Data/SetCreditCardAsDefaultTokenType.php +++ b/app/code/Magento/Vault/Setup/Patch/Data/SetCreditCardAsDefaultTokenType.php @@ -64,7 +64,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Weee/Setup/Patch/Data/InitQuoteAndOrderAttributes.php b/app/code/Magento/Weee/Setup/Patch/Data/InitQuoteAndOrderAttributes.php index 69a1ac08c0a7c..1a40e3b5412e6 100644 --- a/app/code/Magento/Weee/Setup/Patch/Data/InitQuoteAndOrderAttributes.php +++ b/app/code/Magento/Weee/Setup/Patch/Data/InitQuoteAndOrderAttributes.php @@ -110,7 +110,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Widget/Setup/Patch/Data/ConvertSerializedData.php b/app/code/Magento/Widget/Setup/Patch/Data/ConvertSerializedData.php index 300acc87d5565..dad48232f69e9 100644 --- a/app/code/Magento/Widget/Setup/Patch/Data/ConvertSerializedData.php +++ b/app/code/Magento/Widget/Setup/Patch/Data/ConvertSerializedData.php @@ -69,7 +69,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/app/code/Magento/Widget/Setup/Patch/Data/UpgradeModelInstanceClassAliases.php b/app/code/Magento/Widget/Setup/Patch/Data/UpgradeModelInstanceClassAliases.php index 505ea8f9490ac..0a82e5fa223f4 100644 --- a/app/code/Magento/Widget/Setup/Patch/Data/UpgradeModelInstanceClassAliases.php +++ b/app/code/Magento/Widget/Setup/Patch/Data/UpgradeModelInstanceClassAliases.php @@ -68,7 +68,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.0'; } diff --git a/app/code/Magento/Wishlist/Setup/Patch/Data/ConvertSerializedData.php b/app/code/Magento/Wishlist/Setup/Patch/Data/ConvertSerializedData.php index 855534c6355eb..611d23e56f016 100644 --- a/app/code/Magento/Wishlist/Setup/Patch/Data/ConvertSerializedData.php +++ b/app/code/Magento/Wishlist/Setup/Patch/Data/ConvertSerializedData.php @@ -79,7 +79,7 @@ public static function getDependencies() /** * {@inheritdoc} */ - public function getVersion() + public static function getVersion() { return '2.0.1'; } diff --git a/setup/src/Magento/Setup/Model/Installer.php b/setup/src/Magento/Setup/Model/Installer.php index 6ab1a48482f5b..b1e02e3c99d32 100644 --- a/setup/src/Magento/Setup/Model/Installer.php +++ b/setup/src/Magento/Setup/Model/Installer.php @@ -27,6 +27,7 @@ use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\LoggerInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\PatchApplierInterface; use Magento\Framework\Setup\SchemaPersistor; use Magento\Framework\Setup\SchemaSetupInterface; use Magento\Framework\Setup\UpgradeDataInterface; @@ -240,9 +241,9 @@ class Installer private $schemaPersistor; /** - * @var PatchApplier + * @var PatchApplierFactory */ - private $patchApplier; + private $patchApplierFactory; /** * Constructor @@ -322,7 +323,7 @@ public function __construct( DeclarationInstaller::class ); $this->schemaPersistor = $this->objectManagerProvider->get()->get(SchemaPersistor::class); - $this->patchApplier = $this->objectManagerProvider->get()->create(PatchApplier::class); + $this->patchApplierFactory = $this->objectManagerProvider->get()->create(PatchApplierFactory::class); } /** @@ -931,10 +932,12 @@ private function handleDBSchemaData($setup, $type) /** * Applying data patches after old upgrade data scripts */ + /** @var PatchApplier $patchApplier */ + $patchApplier = $this->patchApplierFactory->create(['moduleDataSetup' => $setup]); if ($type === 'schema') { - $this->patchApplier->applySchemaPatch($moduleName); + $patchApplier->applySchemaPatch($moduleName); } elseif ($type === 'data') { - $this->patchApplier->applyDataPatch($moduleName); + $patchApplier->applyDataPatch($moduleName); } if ($type === 'schema') { diff --git a/setup/src/Magento/Setup/Model/Patch/PatchApplier.php b/setup/src/Magento/Setup/Model/Patch/PatchApplier.php index 97ae4b040ead4..e99f548824919 100644 --- a/setup/src/Magento/Setup/Model/Patch/PatchApplier.php +++ b/setup/src/Magento/Setup/Model/Patch/PatchApplier.php @@ -8,6 +8,7 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\Module\ModuleResource; +use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Setup\Exception; /** @@ -45,6 +46,19 @@ class PatchApplier */ private $patchHistory; + /** + * @var PatchFactory + */ + private $patchFactory; + /** + * @var \Magento\Setup\Model\ObjectManagerProvider + */ + private $objectManagerProvider; + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + /** * PatchApplier constructor. * @param PatchReader $dataPatchReader @@ -53,6 +67,8 @@ class PatchApplier * @param ResourceConnection $resourceConnection * @param ModuleResource $moduleResource * @param PatchHistory $patchHistory + * @param PatchFactory $patchFactory + * @param ModuleDataSetupInterface $moduleDataSetup */ public function __construct( PatchReader $dataPatchReader, @@ -60,7 +76,9 @@ public function __construct( PatchRegistryFactory $patchRegistryFactory, ResourceConnection $resourceConnection, ModuleResource $moduleResource, - PatchHistory $patchHistory + PatchHistory $patchHistory, + PatchFactory $patchFactory, + ModuleDataSetupInterface $moduleDataSetup ) { $this->patchRegistryFactory = $patchRegistryFactory; $this->dataPatchReader = $dataPatchReader; @@ -68,20 +86,22 @@ public function __construct( $this->resourceConnection = $resourceConnection; $this->moduleResource = $moduleResource; $this->patchHistory = $patchHistory; + $this->patchFactory = $patchFactory; + $this->moduleDataSetup = $moduleDataSetup; } /** * As we have old scripts and new one we need * - * @param PatchInterface $patch + * @param string $patchClassName * @param string $moduleName * @return bool */ - private function skipByBackwardIncompatability(PatchInterface $patch, $moduleName) + private function skipByBackwardIncompatability(string $patchClassName, $moduleName) { $dbVersion = $this->moduleResource->getDataVersion($moduleName); - return $patch instanceof PatchVersionInterface && - version_compare($patch->getVersion(), $dbVersion) <= 0; + return $patchClassName instanceof PatchVersionInterface && + version_compare(call_user_func([$patchClassName, 'getVersion']), $dbVersion) <= 0; } /** @@ -95,16 +115,11 @@ public function applyDataPatch($moduleName = null) $dataPatches = $this->dataPatchReader->read($moduleName); $registry = $this->prepareRegistry($dataPatches); $adapter = $this->resourceConnection->getConnection(); - /** * @var DataPatchInterface $dataPatch */ foreach ($registry as $dataPatch) { - if (!$dataPatch instanceof DataPatchInterface) { - throw new Exception( - sprintf("Patch %s should implement DataPatchInterface", get_class($dataPatch)) - ); - } + /** * Due to bacward compatabilities reasons some patches should be skipped */ @@ -114,12 +129,20 @@ public function applyDataPatch($moduleName = null) try { $adapter->beginTransaction(); + $dataPatch = $this->patchFactory->create($dataPatch, ['moduleDataSetup' => $this->moduleDataSetup]); + if (!$dataPatch instanceof DataPatchInterface) { + throw new Exception( + sprintf("Patch %s should implement DataPatchInterface", $dataPatch) + ); + } $dataPatch->apply(); $this->patchHistory->fixPatch($dataPatch); $adapter->commit(); } catch (\Exception $e) { $adapter->rollBack(); throw new Exception($e->getMessage()); + } finally { + unset($dataPatch); } } } @@ -158,10 +181,13 @@ public function applySchemaPatch($moduleName = null) */ foreach ($registry as $schemaPatch) { try { + $schemaPatch = $this->patchFactory->create($schemaPatch, ['moduleDataSetup' => $this->moduleDataSetup]); $schemaPatch->apply(); $this->patchHistory->fixPatch($schemaPatch); } catch (\Exception $e) { throw new Exception($e->getMessage()); + } finally { + unset($schemaPatch); } } } @@ -185,12 +211,16 @@ public function revertDataPatches($moduleName = null) if ($dataPatch instanceof PatchRevertableInterface) { try { $adapter->beginTransaction(); + /** @var PatchRevertableInterface|DataPatchInterface $dataPatch */ + $dataPatch = $this->patchFactory->create($dataPatch, ['moduleDataSetup' => $this->moduleDataSetup]); $dataPatch->revert(); $this->patchHistory->revertPatchFromHistory($dataPatch); $adapter->commit(); } catch (\Exception $e) { $adapter->rollBack(); throw new Exception($e->getMessage()); + }finally { + unset($dataPatch); } } } diff --git a/setup/src/Magento/Setup/Model/Patch/PatchApplierFactory.php b/setup/src/Magento/Setup/Model/Patch/PatchApplierFactory.php new file mode 100644 index 0000000000000..69878e214fcd8 --- /dev/null +++ b/setup/src/Magento/Setup/Model/Patch/PatchApplierFactory.php @@ -0,0 +1,39 @@ +objectManager = $objectManager; + } + + /** + * Create new instance of patch applier + * + * @param array $arguments + * @return PatchInterface + */ + public function create($arguments = []) + { + return $this->objectManager->create(\Magento\Setup\Model\Patch\PatchApplier::class, $arguments); + } +} diff --git a/setup/src/Magento/Setup/Model/Patch/PatchFactory.php b/setup/src/Magento/Setup/Model/Patch/PatchFactory.php index 75f6db22cb7a7..aec8dfbd52b5f 100644 --- a/setup/src/Magento/Setup/Model/Patch/PatchFactory.php +++ b/setup/src/Magento/Setup/Model/Patch/PatchFactory.php @@ -26,14 +26,17 @@ public function __construct(ObjectManagerInterface $objectManager) { $this->objectManager = $objectManager; } + /** - * Create new instance of + * Create new instance of patch + * * @param string $instanceName + * @param array $arguments * @return PatchInterface */ - public function create($instanceName) + public function create($instanceName, $arguments = []) { - $patchInstance = $this->objectManager->create('\\' . $instanceName, []); + $patchInstance = $this->objectManager->create('\\' . $instanceName, $arguments); if (!$patchInstance instanceof PatchInterface) { throw new \InvalidArgumentException( sprintf( diff --git a/setup/src/Magento/Setup/Model/Patch/PatchRegistry.php b/setup/src/Magento/Setup/Model/Patch/PatchRegistry.php index 53666ef513a75..a988b2a6ec6c6 100644 --- a/setup/src/Magento/Setup/Model/Patch/PatchRegistry.php +++ b/setup/src/Magento/Setup/Model/Patch/PatchRegistry.php @@ -18,9 +18,9 @@ class PatchRegistry implements \IteratorAggregate private $dependents = []; /** - * @var PatchInterface[] + * @var string[] */ - private $patchInstances = []; + private $patches = []; /** * @var PatchFactory @@ -28,11 +28,11 @@ class PatchRegistry implements \IteratorAggregate private $patchFactory; /** - * This instances need to do revert + * This classes need to do revert * - * @var PatchInterface[] + * @var string[] */ - private $appliedPatchInstances = []; + private $appliedPatches = []; /** * @var PatchHistory @@ -88,41 +88,41 @@ private function registerDependents(string $patchName) public function registerPatch(string $patchName) { if ($this->patchHistory->isApplied($patchName)) { - $this->appliedPatchInstances[$patchName] = $this->patchFactory->create($patchName); + $this->appliedPatches[$patchName] = $patchName; $this->registerDependents($patchName); return false; } - if (isset($this->patchInstances[$patchName])) { - return $this->patchInstances[$patchName]; + if (isset($this->patches[$patchName])) { + return $this->patches[$patchName]; } - $patch = $this->patchFactory->create($patchName); - $this->patchInstances[$patchName] = $patch; + $patch = $patchName; + $this->patches[$patchName] = $patch; return $patch; } /** * Retrieve all patches, that depends on current one * - * @param PatchInterface $patch - * @return PatchInterface[] + * @param string $patch + * @return string[] */ - private function getDependentPatches(PatchInterface $patch) + private function getDependentPatches(string $patch) { $patches = []; - $patchName = get_class($patch); + $patchName = $patch; /** * Let`s check if patch is dependency for other patches */ if (isset($this->dependents[$patchName])) { foreach ($this->dependents[$patchName] as $dependent) { - if (isset($this->appliedPatchInstances[$dependent])) { - $dependent = $this->appliedPatchInstances[$dependent]; + if (isset($this->appliedPatches[$dependent])) { + $dependent = $this->appliedPatches[$dependent]; $patches = array_replace($patches, $this->getDependentPatches($dependent)); - $patches[get_class($dependent)] = $dependent; - unset($this->appliedPatchInstances[get_class($dependent)]); + $patches[$dependent] = $dependent; + unset($this->appliedPatches[$dependent]); } } } @@ -131,14 +131,14 @@ private function getDependentPatches(PatchInterface $patch) } /** - * @param PatchInterface $patch - * @return PatchInterface[] + * @param string $patch + * @return string[] */ - private function getDependencies(PatchInterface $patch) + private function getDependencies(string $patch) { $depInstances = []; - $deps = $patch::getDependencies(); - $this->cyclomaticStack[get_class($patch)] = true; + $deps = call_user_func([$patch, 'getDependencies']); + $this->cyclomaticStack[$patch] = true; foreach ($deps as $dep) { if (isset($this->cyclomaticStack[$dep])) { @@ -154,11 +154,11 @@ private function getDependencies(PatchInterface $patch) continue; } - $depInstances = array_replace($depInstances, $this->getDependencies($this->patchInstances[$dep])); - $depInstances[get_class($depInstance)] = $depInstance; + $depInstances = array_replace($depInstances, $this->getDependencies($this->patches[$dep])); + $depInstances[$depInstance] = $depInstance; } - unset($this->cyclomaticStack[get_class($patch)]); + unset($this->cyclomaticStack[$patch]); return $depInstances; } @@ -175,10 +175,10 @@ public function getReverseIterator() if ($this->reverseIterator === null) { $reversePatches = []; - while (!empty($this->appliedPatchInstances)) { - $patch = array_pop($this->appliedPatchInstances); + while (!empty($this->appliedPatches)) { + $patch = array_pop($this->appliedPatches); $reversePatches = array_replace($reversePatches, $this->getDependentPatches($patch)); - $reversePatches[get_class($patch)] = $patch; + $reversePatches[$patch] = $patch; } $this->reverseIterator = new \ArrayIterator($reversePatches); @@ -198,7 +198,7 @@ public function getIterator() { if ($this->iterator === null) { $installPatches = []; - $patchInstances = $this->patchInstances; + $patchInstances = $this->patches; while (!empty($patchInstances)) { $firstPatch = array_shift($patchInstances); @@ -208,11 +208,11 @@ public function getIterator() * Remove deps from patchInstances */ foreach ($deps as $dep) { - unset($patchInstances[get_class($dep)]); + unset($patchInstances[$dep]); } $installPatches = array_replace($installPatches, $deps); - $installPatches[get_class($firstPatch)] = $firstPatch; + $installPatches[$firstPatch] = $firstPatch; } $this->iterator = new \ArrayIterator($installPatches); diff --git a/setup/src/Magento/Setup/Model/Patch/PatchVersionInterface.php b/setup/src/Magento/Setup/Model/Patch/PatchVersionInterface.php index 9d6525670364b..689bad9cf0d4e 100644 --- a/setup/src/Magento/Setup/Model/Patch/PatchVersionInterface.php +++ b/setup/src/Magento/Setup/Model/Patch/PatchVersionInterface.php @@ -22,5 +22,5 @@ interface PatchVersionInterface * @return string * @deprecated since appearance, required for backward compatibility */ - public function getVersion(); + public static function getVersion(); }