From f958685d0da81c2c2b40fd24a6c8fa85755ae003 Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Mon, 21 Mar 2022 23:41:03 +0200 Subject: [PATCH] Fix constant visibility warnings --- Api/Data/CustomerInterface.php | 14 ++-- Api/Data/ProductUpdateQueueInterface.php | 28 ++++---- Block/Adminhtml/Account/Iframe.php | 2 +- Block/PageType.php | 2 +- .../Command/NostoAccountConnectCommand.php | 6 +- Console/Command/NostoAccountRemoveCommand.php | 2 +- Controller/Adminhtml/Account/Connect.php | 2 +- Controller/Adminhtml/Account/Create.php | 2 +- Controller/Adminhtml/Account/Delete.php | 2 +- Controller/Adminhtml/Account/Index.php | 2 +- Controller/Adminhtml/Account/Proxy.php | 2 +- Controller/Adminhtml/Account/Sync.php | 2 +- Controller/Export/Base.php | 6 +- Controller/Export/Product.php | 2 +- Controller/Frontend/Cart.php | 2 +- CustomerData/HashedTagging.php | 2 +- Exception/ParentProductDisabledException.php | 2 +- Helper/Account.php | 6 +- Helper/Cache.php | 2 +- Helper/Data.php | 68 +++++++++---------- Helper/Price.php | 6 +- Helper/Ratings.php | 6 +- Helper/Url.php | 20 +++--- Helper/Variation.php | 2 +- Model/Cache/Type/ProductData.php | 4 +- Model/Customer/Customer.php | 2 +- .../AbstractDimensionModeConfiguration.php | 4 +- .../Queue/ModeSwitcherConfiguration.php | 2 +- .../ModeSwitcherConfiguration.php | 2 +- .../Dimensions/StoreDimensionProvider.php | 2 +- Model/Indexer/IndexerUtil.php | 4 +- Model/Indexer/QueueIndexer.php | 2 +- Model/Indexer/QueueProcessorIndexer.php | 2 +- Model/Item/Giftcard.php | 2 +- Model/Meta/Account/Builder.php | 4 +- .../Account/Settings/Currencies/Builder.php | 2 +- Model/Order/Builder.php | 2 +- Model/Order/Status/Builder.php | 2 +- Model/Person/Tagging/Builder.php | 8 +-- Model/Product/Builder.php | 2 +- Model/Product/Repository.php | 2 +- Model/ResourceModel/Customer.php | 2 +- Model/ResourceModel/Product/Update/Queue.php | 2 +- Model/ResourceModel/Sku.php | 2 +- .../Stock/Provider/StockRegistryProvider.php | 2 +- Model/Service/Sync/AbstractBulkPublisher.php | 2 +- .../Sync/Delete/AsyncBulkPublisher.php | 4 +- Model/Service/Sync/Delete/DeleteService.php | 6 +- .../Sync/Upsert/AsyncBulkPublisher.php | 4 +- Model/Service/Sync/Upsert/SyncService.php | 4 +- Observer/Adminhtml/Config.php | 4 +- Observer/Cart/Add.php | 2 +- Setup/Core.php | 6 +- Setup/UpgradeSchema.php | 2 +- Util/Customer.php | 4 +- 55 files changed, 142 insertions(+), 142 deletions(-) diff --git a/Api/Data/CustomerInterface.php b/Api/Data/CustomerInterface.php index 9f4f36e85..c4d65335b 100644 --- a/Api/Data/CustomerInterface.php +++ b/Api/Data/CustomerInterface.php @@ -40,17 +40,17 @@ interface CustomerInterface { - const CUSTOMER_ID = 'customer_id'; - const QUOTE_ID = 'quote_id'; - const NOSTO_ID = 'nosto_id'; - const CREATED_AT = 'created_at'; - const UPDATED_AT = 'updated_at'; - const RESTORE_CART_HASH = 'restore_cart_hash'; + public const CUSTOMER_ID = 'customer_id'; + public const QUOTE_ID = 'quote_id'; + public const NOSTO_ID = 'nosto_id'; + public const CREATED_AT = 'created_at'; + public const UPDATED_AT = 'updated_at'; + public const RESTORE_CART_HASH = 'restore_cart_hash'; /** * @var int The length of the restore cart attribute */ - const NOSTO_TAGGING_RESTORE_CART_ATTRIBUTE_LENGTH = 64; + public const NOSTO_TAGGING_RESTORE_CART_ATTRIBUTE_LENGTH = 64; /** * Get customer id diff --git a/Api/Data/ProductUpdateQueueInterface.php b/Api/Data/ProductUpdateQueueInterface.php index d715ecf11..478104d31 100644 --- a/Api/Data/ProductUpdateQueueInterface.php +++ b/Api/Data/ProductUpdateQueueInterface.php @@ -44,20 +44,20 @@ */ interface ProductUpdateQueueInterface { - const ID = 'id'; - const CREATED_AT = 'created_at'; - const STARTED_AT = 'started_at'; - const COMPLETED_AT = 'completed_at'; - const STORE_ID = 'store_id'; - const PRODUCT_IDS = 'product_ids'; - const PRODUCT_ID_COUNT = 'product_id_count'; - const ACTION = 'action'; - const ACTION_VALUE_UPSERT = 'upsert'; - const ACTION_VALUE_DELETE = 'delete'; - const STATUS = 'status'; - const STATUS_VALUE_NEW = 'new'; - const STATUS_VALUE_PROCESSING = 'processing'; - const STATUS_VALUE_DONE = 'done'; + public const ID = 'id'; + public const CREATED_AT = 'created_at'; + public const STARTED_AT = 'started_at'; + public const COMPLETED_AT = 'completed_at'; + public const STORE_ID = 'store_id'; + public const PRODUCT_IDS = 'product_ids'; + public const PRODUCT_ID_COUNT = 'product_id_count'; + public const ACTION = 'action'; + public const ACTION_VALUE_UPSERT = 'upsert'; + public const ACTION_VALUE_DELETE = 'delete'; + public const STATUS = 'status'; + public const STATUS_VALUE_NEW = 'new'; + public const STATUS_VALUE_PROCESSING = 'processing'; + public const STATUS_VALUE_DONE = 'done'; /** * Get row id diff --git a/Block/Adminhtml/Account/Iframe.php b/Block/Adminhtml/Account/Iframe.php index 70d59c844..d33a527fd 100755 --- a/Block/Adminhtml/Account/Iframe.php +++ b/Block/Adminhtml/Account/Iframe.php @@ -59,7 +59,7 @@ class Iframe extends BlockTemplate { use IframeTrait; - const IFRAME_VERSION = 1; + public const IFRAME_VERSION = 1; private $nostoHelperAccount; private $backendAuthSession; diff --git a/Block/PageType.php b/Block/PageType.php index 0c4a780f6..039382009 100644 --- a/Block/PageType.php +++ b/Block/PageType.php @@ -54,7 +54,7 @@ class PageType extends Template /** * Default type assigned to the page if none is set in the layout xml. */ - const DEFAULT_TYPE = 'unknown'; + public const DEFAULT_TYPE = 'unknown'; /** * Constructor. diff --git a/Console/Command/NostoAccountConnectCommand.php b/Console/Command/NostoAccountConnectCommand.php index 6c2766c13..82d0a3650 100644 --- a/Console/Command/NostoAccountConnectCommand.php +++ b/Console/Command/NostoAccountConnectCommand.php @@ -49,9 +49,9 @@ class NostoAccountConnectCommand extends Command { - const NOSTO_ACCOUNT_ID = 'account-id'; - const TOKEN_SUFFIX = '_token'; - const SCOPE_CODE = 'scope-code'; + public const NOSTO_ACCOUNT_ID = 'account-id'; + public const TOKEN_SUFFIX = '_token'; + public const SCOPE_CODE = 'scope-code'; /** * @var NostoHelperAccount diff --git a/Console/Command/NostoAccountRemoveCommand.php b/Console/Command/NostoAccountRemoveCommand.php index 239afb049..3057a57a8 100644 --- a/Console/Command/NostoAccountRemoveCommand.php +++ b/Console/Command/NostoAccountRemoveCommand.php @@ -50,7 +50,7 @@ class NostoAccountRemoveCommand extends Command { - const SCOPE_CODE = 'scope-code'; + public const SCOPE_CODE = 'scope-code'; /** * @var NostoHelperAccount diff --git a/Controller/Adminhtml/Account/Connect.php b/Controller/Adminhtml/Account/Connect.php index 45fbfdd99..e4f6af318 100644 --- a/Controller/Adminhtml/Account/Connect.php +++ b/Controller/Adminhtml/Account/Connect.php @@ -44,7 +44,7 @@ class Connect extends Base { - const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; + public const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; private $result; private $oauthMetaBuilder; private $nostoHelperScope; diff --git a/Controller/Adminhtml/Account/Create.php b/Controller/Adminhtml/Account/Create.php index 9c74d8a74..adc7714ea 100644 --- a/Controller/Adminhtml/Account/Create.php +++ b/Controller/Adminhtml/Account/Create.php @@ -59,7 +59,7 @@ class Create extends Base { - const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; + public const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; private $result; private $nostoHelperAccount; private $nostoCurrentUserBuilder; diff --git a/Controller/Adminhtml/Account/Delete.php b/Controller/Adminhtml/Account/Delete.php index 05a80cf65..b369272aa 100644 --- a/Controller/Adminhtml/Account/Delete.php +++ b/Controller/Adminhtml/Account/Delete.php @@ -51,7 +51,7 @@ class Delete extends Base { - const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; + public const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; private $result; private $nostoHelperAccount; private $nostoCurrentUserBuilder; diff --git a/Controller/Adminhtml/Account/Index.php b/Controller/Adminhtml/Account/Index.php index 652ac5c97..4054de56d 100755 --- a/Controller/Adminhtml/Account/Index.php +++ b/Controller/Adminhtml/Account/Index.php @@ -47,7 +47,7 @@ class Index extends Base { - const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; + public const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; private $resultPageFactory; private $nostoHelperScope; diff --git a/Controller/Adminhtml/Account/Proxy.php b/Controller/Adminhtml/Account/Proxy.php index 9f0c3d433..fbb2e7bc3 100644 --- a/Controller/Adminhtml/Account/Proxy.php +++ b/Controller/Adminhtml/Account/Proxy.php @@ -42,7 +42,7 @@ class Proxy extends Base { - const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; + public const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; protected $_publicActions = ['proxy']; // @codingStandardsIgnoreLine private $backendAuthSession; diff --git a/Controller/Adminhtml/Account/Sync.php b/Controller/Adminhtml/Account/Sync.php index 9ac328750..556e7c49b 100644 --- a/Controller/Adminhtml/Account/Sync.php +++ b/Controller/Adminhtml/Account/Sync.php @@ -45,7 +45,7 @@ class Sync extends Base { - const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; + public const ADMIN_RESOURCE = 'Nosto_Tagging::system_nosto_account'; private $result; private $nostoHelperAccount; private $oauthMetaBuilder; diff --git a/Controller/Export/Base.php b/Controller/Export/Base.php index af3e98fa1..d41f511eb 100644 --- a/Controller/Export/Base.php +++ b/Controller/Export/Base.php @@ -54,9 +54,9 @@ // https://community.magento.com/t5/Magento-DevBlog/Decomposition-of-Magento-Controllers/ba-p/430883 abstract class Base extends Action { - const ID = 'id'; - const LIMIT = 'limit'; - const OFFSET = 'offset'; + public const ID = 'id'; + public const LIMIT = 'limit'; + public const OFFSET = 'offset'; private $nostoHelperAccount; private $nostoHelperScope; diff --git a/Controller/Export/Product.php b/Controller/Export/Product.php index 68a077d70..3aa2084f5 100755 --- a/Controller/Export/Product.php +++ b/Controller/Export/Product.php @@ -54,7 +54,7 @@ */ class Product extends Base { - const PARAM_PREVIEW = 'preview'; + public const PARAM_PREVIEW = 'preview'; /** @var CollectionBuilder */ private $nostoCollectionBuilder; diff --git a/Controller/Frontend/Cart.php b/Controller/Frontend/Cart.php index 6c9f17d9c..694ed419d 100755 --- a/Controller/Frontend/Cart.php +++ b/Controller/Frontend/Cart.php @@ -64,7 +64,7 @@ class Cart extends Action /** * The name of the hash parameter to look from URL */ - const HASH_PARAM = 'h'; + public const HASH_PARAM = 'h'; private $context; private $moduleManager; diff --git a/CustomerData/HashedTagging.php b/CustomerData/HashedTagging.php index 1604c82cf..e04e94574 100644 --- a/CustomerData/HashedTagging.php +++ b/CustomerData/HashedTagging.php @@ -42,7 +42,7 @@ abstract class HashedTagging /** * @var string the algorithm to use for hashing visitor id. */ - const VISITOR_HASH_ALGO = 'sha256'; + public const VISITOR_HASH_ALGO = 'sha256'; /** * Return the checksum for for the customer tagging i.e hashed cookie identifier or HCID for diff --git a/Exception/ParentProductDisabledException.php b/Exception/ParentProductDisabledException.php index ab9a3c8e4..7ad994d4c 100644 --- a/Exception/ParentProductDisabledException.php +++ b/Exception/ParentProductDisabledException.php @@ -41,7 +41,7 @@ class ParentProductDisabledException extends NostoException { - function __construct(int $productId, $code = 0, Throwable $previous = null) + public function __construct(int $productId, $code = 0, Throwable $previous = null) { $message = "Parent product is disabled for SKU with id: " . $productId; parent::__construct($message, $code, $previous); diff --git a/Helper/Account.php b/Helper/Account.php index 36087cb18..5e37ef07f 100644 --- a/Helper/Account.php +++ b/Helper/Account.php @@ -64,17 +64,17 @@ class Account extends AbstractHelper /** * Path to store config nosto account name. */ - const XML_PATH_ACCOUNT = 'nosto_tagging/settings/account'; + public const XML_PATH_ACCOUNT = 'nosto_tagging/settings/account'; /** * Path to store config nosto account tokens. */ - const XML_PATH_TOKENS = 'nosto_tagging/settings/tokens'; + public const XML_PATH_TOKENS = 'nosto_tagging/settings/tokens'; /** * Path to store config store domain. */ - const XML_PATH_DOMAIN = 'nosto_tagging/settings/domain'; + public const XML_PATH_DOMAIN = 'nosto_tagging/settings/domain'; private $config; private $moduleManager; diff --git a/Helper/Cache.php b/Helper/Cache.php index cf3dd5b47..94023528b 100755 --- a/Helper/Cache.php +++ b/Helper/Cache.php @@ -50,7 +50,7 @@ */ class Cache extends AbstractHelper { - const CACHE_ID_LAYOUT = 'layout'; + public const CACHE_ID_LAYOUT = 'layout'; /** @var TypeListInterface $typeList */ private $typeList; diff --git a/Helper/Data.php b/Helper/Data.php index 9f5e6a3a4..b8c4b3998 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -57,152 +57,152 @@ class Data extends AbstractHelper /** * Path to store config installation ID. */ - const XML_PATH_INSTALLATION_ID = 'nosto_tagging/installation/id'; + public const XML_PATH_INSTALLATION_ID = 'nosto_tagging/installation/id'; /** * Path to store config product image version setting. */ - const XML_PATH_IMAGE_VERSION = 'nosto/images/version'; + public const XML_PATH_IMAGE_VERSION = 'nosto/images/version'; /** * Path to store config for removing "pub/" directory from image URLs */ - const XML_PATH_IMAGE_REMOVE_PUB_FROM_URL = 'nosto/images/remove_pub_directory'; + public const XML_PATH_IMAGE_REMOVE_PUB_FROM_URL = 'nosto/images/remove_pub_directory'; /** * Path to the configuration object that store's the brand attribute */ - const XML_PATH_BRAND_ATTRIBUTE = 'nosto/optional/brand'; + public const XML_PATH_BRAND_ATTRIBUTE = 'nosto/optional/brand'; /** * Path to the configuration object that store's the margin attribute */ - const XML_PATH_MARGIN_ATTRIBUTE = 'nosto/optional/margin'; + public const XML_PATH_MARGIN_ATTRIBUTE = 'nosto/optional/margin'; /** * Path to the configuration object that store's the GTIN attribute */ - const XML_PATH_GTIN_ATTRIBUTE = 'nosto/optional/gtin'; + public const XML_PATH_GTIN_ATTRIBUTE = 'nosto/optional/gtin'; /** * Path to the configuration object that store's the google_category attribute */ - const XML_PATH_GOOGLE_CATEGORY_ATTRIBUTE = 'nosto/optional/google_category'; + public const XML_PATH_GOOGLE_CATEGORY_ATTRIBUTE = 'nosto/optional/google_category'; /** * Path to the configuration object that stores the preference to tag variation data */ - const XML_PATH_VARIATION_TAGGING = 'nosto/flags/variation_tagging'; + public const XML_PATH_VARIATION_TAGGING = 'nosto/flags/variation_tagging'; /** * Path to store config for custom fields */ - const XML_PATH_USE_CUSTOM_FIELDS = 'nosto/flags/use_custom_fields'; + public const XML_PATH_USE_CUSTOM_FIELDS = 'nosto/flags/use_custom_fields'; /** * Path to the configuration object that stores the preference to tag alt. image data */ - const XML_PATH_ALTIMG_TAGGING = 'nosto/flags/altimg_tagging'; + public const XML_PATH_ALTIMG_TAGGING = 'nosto/flags/altimg_tagging'; /** * Path to the configuration object that stores the preference to tag rating and review data */ - const XML_PATH_RATING_TAGGING = 'nosto/flags/rating_tagging'; + public const XML_PATH_RATING_TAGGING = 'nosto/flags/rating_tagging'; /** * Path to the configuration object that stores the preference to tag inventory data */ - const XML_PATH_INVENTORY_TAGGING = 'nosto/flags/inventory_tagging'; + public const XML_PATH_INVENTORY_TAGGING = 'nosto/flags/inventory_tagging'; /** * Path to the configuration object that stores the preference for real time product updates */ - const XML_PATH_PRODUCT_UPDATES = 'nosto/flags/product_updates'; + public const XML_PATH_PRODUCT_UPDATES = 'nosto/flags/product_updates'; /** * Path to store config for sending customer data to Nosto or not */ - const XML_PATH_SEND_CUSTOMER_DATA = 'nosto/flags/send_customer_data'; + public const XML_PATH_SEND_CUSTOMER_DATA = 'nosto/flags/send_customer_data'; /** * Path to the configuration object that stores the preference for low stock tagging */ - const XML_PATH_LOW_STOCK_INDICATION = 'nosto/flags/low_stock_indication'; + public const XML_PATH_LOW_STOCK_INDICATION = 'nosto/flags/low_stock_indication'; /** * Path to the configuration object that stores the percentage of PHP available memory for indexer */ - const XML_PATH_INDEXER_MEMORY = 'nosto/flags/indexer_memory'; + public const XML_PATH_INDEXER_MEMORY = 'nosto/flags/indexer_memory'; /** * Path to the configuration object that stores the preference for indexing disabled products */ - const XML_PATH_INDEX_DISABLED_PRODUCTS = 'nosto/flags/indexer_disabled_products'; + public const XML_PATH_INDEX_DISABLED_PRODUCTS = 'nosto/flags/indexer_disabled_products'; /* * Path to the configuration object for tagging the date a product has beed added to Magento's catalog */ - const XML_PATH_TAG_DATE_PUBLISHED = 'nosto/flags/tag_date_published'; + public const XML_PATH_TAG_DATE_PUBLISHED = 'nosto/flags/tag_date_published'; /** * Path to the configuration object that stores customer reference */ - const XML_PATH_TRACK_MULTI_CHANNEL_ORDERS = 'nosto/flags/track_multi_channel_orders'; + public const XML_PATH_TRACK_MULTI_CHANNEL_ORDERS = 'nosto/flags/track_multi_channel_orders'; /** * Path to the configuration object that stores preference for reloading recs after adding product to cart */ - const XML_PATH_RELOAD_RECS_AFTER_ATC = 'nosto/flags/reload_recs_after_atc'; + public const XML_PATH_RELOAD_RECS_AFTER_ATC = 'nosto/flags/reload_recs_after_atc'; /** * Path to the configuration object for pricing variations */ - const XML_PATH_PRICING_VARIATION = 'nosto/multicurrency/pricing_variation'; + public const XML_PATH_PRICING_VARIATION = 'nosto/multicurrency/pricing_variation'; /** * Path to the configuration object that stores the preference for adding store code to URL */ - const XML_PATH_STORE_CODE_TO_URL = 'nosto/url/store_code_to_url'; + public const XML_PATH_STORE_CODE_TO_URL = 'nosto/url/store_code_to_url'; /** * Path to the configuration object for customized tags */ - const XML_PATH_TAG = 'nosto/attributes/'; + public const XML_PATH_TAG = 'nosto/attributes/'; /** * Path to the configuration object for multi currency */ - const XML_PATH_MULTI_CURRENCY = 'nosto/multicurrency/method'; + public const XML_PATH_MULTI_CURRENCY = 'nosto/multicurrency/method'; /** * @var string Nosto customer reference attribute name */ - const NOSTO_CUSTOMER_REFERENCE_ATTRIBUTE_NAME = 'nosto_customer_reference'; + public const NOSTO_CUSTOMER_REFERENCE_ATTRIBUTE_NAME = 'nosto_customer_reference'; /** * Values for ratings settings */ - const SETTING_VALUE_YOTPO_RATINGS = '2'; - const SETTING_VALUE_MAGENTO_RATINGS = '1'; - const SETTING_VALUE_NO_RATINGS = '0'; + public const SETTING_VALUE_YOTPO_RATINGS = '2'; + public const SETTING_VALUE_MAGENTO_RATINGS = '1'; + public const SETTING_VALUE_NO_RATINGS = '0'; /** * Values of the multi currency settings */ - const SETTING_VALUE_MC_EXCHANGE_RATE = 'exchangerates'; - const SETTING_VALUE_MC_SINGLE = 'single'; - const SETTING_VALUE_MC_DISABLED = 'disabled'; - const SETTING_VALUE_MC_UNDEFINED = 'undefined'; + public const SETTING_VALUE_MC_EXCHANGE_RATE = 'exchangerates'; + public const SETTING_VALUE_MC_SINGLE = 'single'; + public const SETTING_VALUE_MC_DISABLED = 'disabled'; + public const SETTING_VALUE_MC_UNDEFINED = 'undefined'; /** * Name of the module */ - const MODULE_NAME = 'Nosto_Tagging'; + public const MODULE_NAME = 'Nosto_Tagging'; /** * Name of the platform */ - const PLATFORM_NAME = 'Magento'; + public const PLATFORM_NAME = 'Magento'; private $moduleListing; private $configWriter; diff --git a/Helper/Price.php b/Helper/Price.php index 6f7a19a5e..ae5e4f943 100644 --- a/Helper/Price.php +++ b/Helper/Price.php @@ -69,9 +69,9 @@ class Price extends AbstractHelper private $nostoProductRepository; private $taxHelper; - const KEY_SKU_FINAL_PRICE = 'final_price'; - const KEY_SKU_PRICE = 'price'; - const KEY_SKU_PRODUCT_ID = 'entity_id'; + public const KEY_SKU_FINAL_PRICE = 'final_price'; + public const KEY_SKU_PRICE = 'price'; + public const KEY_SKU_PRODUCT_ID = 'entity_id'; /** * Constructor. diff --git a/Helper/Ratings.php b/Helper/Ratings.php index 5753517b8..94a454afc 100644 --- a/Helper/Ratings.php +++ b/Helper/Ratings.php @@ -53,9 +53,9 @@ */ class Ratings extends AbstractHelper { - const REVIEW_COUNT = 'reviews_count'; - const AVERAGE_SCORE = 'average_score'; - const CURRENT_PRODUCT = 'current_product'; + public const REVIEW_COUNT = 'reviews_count'; + public const AVERAGE_SCORE = 'average_score'; + public const CURRENT_PRODUCT = 'current_product'; private $moduleManager; private $nostoDataHelper; diff --git a/Helper/Url.php b/Helper/Url.php index cec670ec9..e6ece9eba 100755 --- a/Helper/Url.php +++ b/Helper/Url.php @@ -62,39 +62,39 @@ */ class Url extends AbstractHelper { - const URL_PATH_NOSTO_CONFIG = 'adminhtml/system_config/edit/section/nosto/'; - const MAGENTO_URL_OPTION_STORE_ID = 'store'; + public const URL_PATH_NOSTO_CONFIG = 'adminhtml/system_config/edit/section/nosto/'; + public const MAGENTO_URL_OPTION_STORE_ID = 'store'; - const MAGENTO_PATH_SEARCH_RESULT = 'catalogsearch/result'; + public const MAGENTO_PATH_SEARCH_RESULT = 'catalogsearch/result'; /** * Path to Magento's cart controller */ - const MAGENTO_PATH_CART = 'checkout/cart'; + public const MAGENTO_PATH_CART = 'checkout/cart'; /** * The ___store parameter in Magento URLs */ - const MAGENTO_URL_PARAMETER_STORE = '___store'; + public const MAGENTO_URL_PARAMETER_STORE = '___store'; /** * The array option key for scope in Magento's URLs */ - const MAGENTO_URL_OPTION_SCOPE = '_scope'; + public const MAGENTO_URL_OPTION_SCOPE = '_scope'; /** * The array option key for store to url in Magento's URLs */ - const MAGENTO_URL_OPTION_SCOPE_TO_URL = '_scope_to_url'; + public const MAGENTO_URL_OPTION_SCOPE_TO_URL = '_scope_to_url'; /** * The array option key for URL type in Magento's URLs */ - const MAGENTO_URL_OPTION_LINK_TYPE = '_type'; + public const MAGENTO_URL_OPTION_LINK_TYPE = '_type'; /** * Path to Nosto's restore cart controller */ - const NOSTO_PATH_RESTORE_CART = 'nosto/frontend/cart'; + public const NOSTO_PATH_RESTORE_CART = 'nosto/frontend/cart'; /** * The array option key for no session id in Magento's URLs. @@ -103,7 +103,7 @@ class Url extends AbstractHelper * product URLs we cannot include the session id as the product URL should * be the same for all visitors and it will be saved to Nosto. */ - const MAGENTO_URL_OPTION_NOSID = '_nosid'; + public const MAGENTO_URL_OPTION_NOSID = '_nosid'; /** * The url type to be used for links. diff --git a/Helper/Variation.php b/Helper/Variation.php index 4a0402136..691eab4f3 100644 --- a/Helper/Variation.php +++ b/Helper/Variation.php @@ -52,7 +52,7 @@ */ class Variation extends AbstractHelper { - const DEFAULT_CUSTOMER_GROUP_ID = GroupManagement::NOT_LOGGED_IN_ID; + public const DEFAULT_CUSTOMER_GROUP_ID = GroupManagement::NOT_LOGGED_IN_ID; /** @var GroupRepository */ private $groupRepository; diff --git a/Model/Cache/Type/ProductData.php b/Model/Cache/Type/ProductData.php index 08fb20db7..660df6d9f 100644 --- a/Model/Cache/Type/ProductData.php +++ b/Model/Cache/Type/ProductData.php @@ -44,12 +44,12 @@ class ProductData extends TagScope implements ProductDataInterface /** * Cache type code unique among all cache types */ - const TYPE_IDENTIFIER = 'nosto_product_cache'; + public const TYPE_IDENTIFIER = 'nosto_product_cache'; /** * The tag name that limits the cache cleaning scope within a particular tag */ - const CACHE_TAG = 'NOSTO_PRODUCT'; + public const CACHE_TAG = 'NOSTO_PRODUCT'; /** * @param FrontendPool $cacheFrontendPool diff --git a/Model/Customer/Customer.php b/Model/Customer/Customer.php index add9f71cd..86840040f 100644 --- a/Model/Customer/Customer.php +++ b/Model/Customer/Customer.php @@ -46,7 +46,7 @@ class Customer extends AbstractModel implements CustomerInterface /** * Name of cookie that holds Nosto visitor id */ - const COOKIE_NAME = '2c_cId'; + public const COOKIE_NAME = '2c_cId'; /** * @inheritDoc diff --git a/Model/Indexer/Dimensions/AbstractDimensionModeConfiguration.php b/Model/Indexer/Dimensions/AbstractDimensionModeConfiguration.php index 9927e33c5..387b81ed2 100644 --- a/Model/Indexer/Dimensions/AbstractDimensionModeConfiguration.php +++ b/Model/Indexer/Dimensions/AbstractDimensionModeConfiguration.php @@ -43,8 +43,8 @@ abstract class AbstractDimensionModeConfiguration /** * Available modes of dimensions for nosto product data indexer */ - const DIMENSION_NONE = 'none'; - const DIMENSION_STORE = 'store'; + public const DIMENSION_NONE = 'none'; + public const DIMENSION_STORE = 'store'; /** * Mapping between dimension mode and dimension provider name diff --git a/Model/Indexer/Dimensions/Queue/ModeSwitcherConfiguration.php b/Model/Indexer/Dimensions/Queue/ModeSwitcherConfiguration.php index 43831f1e6..39605d543 100644 --- a/Model/Indexer/Dimensions/Queue/ModeSwitcherConfiguration.php +++ b/Model/Indexer/Dimensions/Queue/ModeSwitcherConfiguration.php @@ -42,7 +42,7 @@ class ModeSwitcherConfiguration { - const XML_PATH_PRODUCT_QUEUE_DIMENSIONS_MODE = 'indexer/nosto_index_product_queue/dimensions_mode'; + public const XML_PATH_PRODUCT_QUEUE_DIMENSIONS_MODE = 'indexer/nosto_index_product_queue/dimensions_mode'; /** * ConfigInterface diff --git a/Model/Indexer/Dimensions/QueueProcessor/ModeSwitcherConfiguration.php b/Model/Indexer/Dimensions/QueueProcessor/ModeSwitcherConfiguration.php index f319037e9..9e8ad692e 100644 --- a/Model/Indexer/Dimensions/QueueProcessor/ModeSwitcherConfiguration.php +++ b/Model/Indexer/Dimensions/QueueProcessor/ModeSwitcherConfiguration.php @@ -43,7 +43,7 @@ class ModeSwitcherConfiguration { // phpcs:ignore Generic.Files.LineLength - const XML_PATH_PRODUCT_QUEUE_PROCESSOR_DIMENSIONS_MODE = 'indexer/nosto_index_product_queue_processor/dimensions_mode'; + public const XML_PATH_PRODUCT_QUEUE_PROCESSOR_DIMENSIONS_MODE = 'indexer/nosto_index_product_queue_processor/dimensions_mode'; /** * ConfigInterface diff --git a/Model/Indexer/Dimensions/StoreDimensionProvider.php b/Model/Indexer/Dimensions/StoreDimensionProvider.php index f9edcbf41..699a62592 100644 --- a/Model/Indexer/Dimensions/StoreDimensionProvider.php +++ b/Model/Indexer/Dimensions/StoreDimensionProvider.php @@ -49,7 +49,7 @@ class StoreDimensionProvider implements DimensionProviderInterface * Hold the name of Store dimension. Uses for retrieve dimension value. * Used "scope" name for support current indexer implementation */ - const DIMENSION_NAME = 'scope'; + public const DIMENSION_NAME = 'scope'; /** @var StoreManagerInterface */ private $storeManager; diff --git a/Model/Indexer/IndexerUtil.php b/Model/Indexer/IndexerUtil.php index d9674d072..720e92986 100644 --- a/Model/Indexer/IndexerUtil.php +++ b/Model/Indexer/IndexerUtil.php @@ -42,10 +42,10 @@ class IndexerUtil { /** Non-ambiguous scope for settings commands */ - const SETUP_UPGRADE_SCOPE = 'se'; + public const SETUP_UPGRADE_SCOPE = 'se'; /** Non-ambiguous action argument for settings command */ - const SETUP_UPGRADE_ACTION = 'up'; + public const SETUP_UPGRADE_ACTION = 'up'; /** * Checks if the execution scope is from Magento's setup:upgrade diff --git a/Model/Indexer/QueueIndexer.php b/Model/Indexer/QueueIndexer.php index 82fe54b01..1e768353d 100644 --- a/Model/Indexer/QueueIndexer.php +++ b/Model/Indexer/QueueIndexer.php @@ -61,7 +61,7 @@ */ class QueueIndexer extends AbstractIndexer { - const INDEXER_ID = 'nosto_index_product_queue'; + public const INDEXER_ID = 'nosto_index_product_queue'; /** @var QueueService */ private $queueService; diff --git a/Model/Indexer/QueueProcessorIndexer.php b/Model/Indexer/QueueProcessorIndexer.php index 767377287..715a15728 100644 --- a/Model/Indexer/QueueProcessorIndexer.php +++ b/Model/Indexer/QueueProcessorIndexer.php @@ -58,7 +58,7 @@ */ class QueueProcessorIndexer extends AbstractIndexer { - const INDEXER_ID = 'nosto_index_product_queue_processor'; + public const INDEXER_ID = 'nosto_index_product_queue_processor'; /** @var QueueProcessorService */ private $queueProcessorService; diff --git a/Model/Item/Giftcard.php b/Model/Item/Giftcard.php index d14356bd0..805ae0708 100644 --- a/Model/Item/Giftcard.php +++ b/Model/Item/Giftcard.php @@ -38,7 +38,7 @@ class Giftcard { - const GIFTCARD_TYPE = 'giftcard'; + public const GIFTCARD_TYPE = 'giftcard'; /** * Returns the product type for gift card item diff --git a/Model/Meta/Account/Builder.php b/Model/Meta/Account/Builder.php index f140b8741..a14e50914 100644 --- a/Model/Meta/Account/Builder.php +++ b/Model/Meta/Account/Builder.php @@ -52,8 +52,8 @@ class Builder { - const API_TOKEN = 'YBDKYwSqTCzSsU8Bwbg4im2pkHMcgTy9cCX7vevjJwON1UISJIwXOLMM0a8nZY7h'; - const PLATFORM_NAME = 'magento'; + public const API_TOKEN = 'YBDKYwSqTCzSsU8Bwbg4im2pkHMcgTy9cCX7vevjJwON1UISJIwXOLMM0a8nZY7h'; + public const PLATFORM_NAME = 'magento'; private $accountBillingMetaBuilder; private $localeResolver; private $logger; diff --git a/Model/Meta/Account/Settings/Currencies/Builder.php b/Model/Meta/Account/Settings/Currencies/Builder.php index f957d5b8c..12901b418 100644 --- a/Model/Meta/Account/Settings/Currencies/Builder.php +++ b/Model/Meta/Account/Settings/Currencies/Builder.php @@ -65,7 +65,7 @@ class Builder private $nostoCurrencyHelper; /* List of zero decimal currencies in compliance with ISO-4217 */ - const ZERO_DECIMAL_CURRENCIES = [ + public const ZERO_DECIMAL_CURRENCIES = [ 'XOF', 'BIF', 'XAF', diff --git a/Model/Order/Builder.php b/Model/Order/Builder.php index 090e5feca..d25d32627 100644 --- a/Model/Order/Builder.php +++ b/Model/Order/Builder.php @@ -57,7 +57,7 @@ class Builder { - const ORDER_NUMBER_PREFIX = 'M2_'; + public const ORDER_NUMBER_PREFIX = 'M2_'; private $logger; private $salesRuleFactory; diff --git a/Model/Order/Status/Builder.php b/Model/Order/Status/Builder.php index 6f76145c7..984da393f 100644 --- a/Model/Order/Status/Builder.php +++ b/Model/Order/Status/Builder.php @@ -46,7 +46,7 @@ class Builder { - const ORDER_NUMBER_PREFIX = 'M2_'; + public const ORDER_NUMBER_PREFIX = 'M2_'; /** @var NostoLogger */ private $logger; diff --git a/Model/Person/Tagging/Builder.php b/Model/Person/Tagging/Builder.php index 7698207d5..3e1fdbf19 100644 --- a/Model/Person/Tagging/Builder.php +++ b/Model/Person/Tagging/Builder.php @@ -58,10 +58,10 @@ class Builder extends PersonBuilder { - const GENDER_MALE = 'Male'; - const GENDER_FEMALE = 'Female'; - const GENDER_MALE_ID = '1'; - const GENDER_FEMALE_ID = '2'; + public const GENDER_MALE = 'Male'; + public const GENDER_FEMALE = 'Female'; + public const GENDER_MALE_ID = '1'; + public const GENDER_FEMALE_ID = '2'; private $groupRepository; private $customerRepository; diff --git a/Model/Product/Builder.php b/Model/Product/Builder.php index c40f162a4..6f62f4b99 100644 --- a/Model/Product/Builder.php +++ b/Model/Product/Builder.php @@ -65,7 +65,7 @@ class Builder { - const CUSTOMIZED_TAGS = ['tag1', 'tag2', 'tag3']; + public const CUSTOMIZED_TAGS = ['tag1', 'tag2', 'tag3']; /** @var NostoDataHelper */ private $nostoDataHelper; diff --git a/Model/Product/Repository.php b/Model/Product/Repository.php index f200c724f..1a7773500 100644 --- a/Model/Product/Repository.php +++ b/Model/Product/Repository.php @@ -60,7 +60,7 @@ */ class Repository { - const MAX_SKUS = 5000; + public const MAX_SKUS = 5000; private $parentProductIdCache = []; diff --git a/Model/ResourceModel/Customer.php b/Model/ResourceModel/Customer.php index 6d828bdfd..aa322e04b 100644 --- a/Model/ResourceModel/Customer.php +++ b/Model/ResourceModel/Customer.php @@ -41,7 +41,7 @@ class Customer extends AbstractDb { - const TABLE_NAME = 'nosto_tagging_customer'; + public const TABLE_NAME = 'nosto_tagging_customer'; /** * Initialize resource model diff --git a/Model/ResourceModel/Product/Update/Queue.php b/Model/ResourceModel/Product/Update/Queue.php index 28e5e862e..a54195102 100644 --- a/Model/ResourceModel/Product/Update/Queue.php +++ b/Model/ResourceModel/Product/Update/Queue.php @@ -43,7 +43,7 @@ class Queue extends AbstractDb { protected $_serializableFields = [ProductUpdateQueueInterface::PRODUCT_IDS => [[], []]]; - const TABLE_NAME = 'nosto_tagging_product_update_queue'; + public const TABLE_NAME = 'nosto_tagging_product_update_queue'; /** * Initialize resource model * diff --git a/Model/ResourceModel/Sku.php b/Model/ResourceModel/Sku.php index 438bbf431..333ac2cc9 100644 --- a/Model/ResourceModel/Sku.php +++ b/Model/ResourceModel/Sku.php @@ -43,7 +43,7 @@ class Sku extends ProductResource { - const CATALOG_PRODUCT_PRICE_INDEX_TABLE = "catalog_product_index_price"; + public const CATALOG_PRODUCT_PRICE_INDEX_TABLE = "catalog_product_index_price"; /** * Fetches prices for the SKUs regardless if they are in stock or not diff --git a/Model/Service/Stock/Provider/StockRegistryProvider.php b/Model/Service/Stock/Provider/StockRegistryProvider.php index ab90aae6b..0fe19cb24 100644 --- a/Model/Service/Stock/Provider/StockRegistryProvider.php +++ b/Model/Service/Stock/Provider/StockRegistryProvider.php @@ -76,7 +76,7 @@ class StockRegistryProvider extends MagentoStockRegistryProvider { - const DEFAULT_STOCK_SCOPE = 0; + public const DEFAULT_STOCK_SCOPE = 0; /** * @param int[] $productIds diff --git a/Model/Service/Sync/AbstractBulkPublisher.php b/Model/Service/Sync/AbstractBulkPublisher.php index 4e1c507b5..54dca6365 100644 --- a/Model/Service/Sync/AbstractBulkPublisher.php +++ b/Model/Service/Sync/AbstractBulkPublisher.php @@ -48,7 +48,7 @@ abstract class AbstractBulkPublisher implements BulkPublisherInterface { - const STATUS_TYPE_OPEN = 4; //\Magento\Framework\Bulk\OperationInterface::STATUS_TYPE_OPEN; + private const STATUS_TYPE_OPEN = 4; //\Magento\Framework\Bulk\OperationInterface::STATUS_TYPE_OPEN; /** @var \Magento\Framework\Bulk\BulkManagementInterface|null */ private $bulkManagement; diff --git a/Model/Service/Sync/Delete/AsyncBulkPublisher.php b/Model/Service/Sync/Delete/AsyncBulkPublisher.php index 52db67152..5198406c7 100644 --- a/Model/Service/Sync/Delete/AsyncBulkPublisher.php +++ b/Model/Service/Sync/Delete/AsyncBulkPublisher.php @@ -40,8 +40,8 @@ class AsyncBulkPublisher extends AbstractBulkPublisher { - const NOSTO_DELETE_MESSAGE_QUEUE = 'nosto_product_sync.delete'; - const BULK_SIZE = 100; + public const NOSTO_DELETE_MESSAGE_QUEUE = 'nosto_product_sync.delete'; + public const BULK_SIZE = 100; /** * @inheritDoc diff --git a/Model/Service/Sync/Delete/DeleteService.php b/Model/Service/Sync/Delete/DeleteService.php index 4b23f37c3..4e204eaad 100644 --- a/Model/Service/Sync/Delete/DeleteService.php +++ b/Model/Service/Sync/Delete/DeleteService.php @@ -51,9 +51,9 @@ class DeleteService extends AbstractService { - const BENCHMARK_DELETE_NAME = 'nosto_product_delete'; - const BENCHMARK_DELETE_BREAKPOINT = 1; - const PRODUCT_DELETION_BATCH_SIZE = 100; + public const BENCHMARK_DELETE_NAME = 'nosto_product_delete'; + public const BENCHMARK_DELETE_BREAKPOINT = 1; + public const PRODUCT_DELETION_BATCH_SIZE = 100; /** @var CacheService */ private $cacheService; diff --git a/Model/Service/Sync/Upsert/AsyncBulkPublisher.php b/Model/Service/Sync/Upsert/AsyncBulkPublisher.php index e57b87a42..ecde254b9 100644 --- a/Model/Service/Sync/Upsert/AsyncBulkPublisher.php +++ b/Model/Service/Sync/Upsert/AsyncBulkPublisher.php @@ -41,8 +41,8 @@ // @codingStandardsIgnoreFile class AsyncBulkPublisher extends AbstractBulkPublisher { - const NOSTO_SYNC_MESSAGE_QUEUE = 'nosto_product_sync.update'; - const BULK_SIZE = 100; + public const NOSTO_SYNC_MESSAGE_QUEUE = 'nosto_product_sync.update'; + public const BULK_SIZE = 100; /** * @inheritDoc diff --git a/Model/Service/Sync/Upsert/SyncService.php b/Model/Service/Sync/Upsert/SyncService.php index 0b30d82da..8eebec797 100644 --- a/Model/Service/Sync/Upsert/SyncService.php +++ b/Model/Service/Sync/Upsert/SyncService.php @@ -55,8 +55,8 @@ class SyncService extends AbstractService { - const BENCHMARK_SYNC_NAME = 'nosto_product_upsert'; - const BENCHMARK_SYNC_BREAKPOINT = 1; + public const BENCHMARK_SYNC_NAME = 'nosto_product_upsert'; + public const BENCHMARK_SYNC_BREAKPOINT = 1; /** @var NostoHelperAccount */ private $nostoHelperAccount; diff --git a/Observer/Adminhtml/Config.php b/Observer/Adminhtml/Config.php index b5b20862c..2f139747e 100644 --- a/Observer/Adminhtml/Config.php +++ b/Observer/Adminhtml/Config.php @@ -54,8 +54,8 @@ */ class Config implements ObserverInterface { - const WEBSITE_SCOPE_KEY = 'website'; - const STORE_SCOPE_KEY = 'store'; + public const WEBSITE_SCOPE_KEY = 'website'; + public const STORE_SCOPE_KEY = 'store'; /** @var NostoLogger */ private $logger; diff --git a/Observer/Cart/Add.php b/Observer/Cart/Add.php index c46139be6..f504d8382 100644 --- a/Observer/Cart/Add.php +++ b/Observer/Cart/Add.php @@ -65,7 +65,7 @@ class Add implements ObserverInterface private $nostoCartItemBuilder; private $nostoCartBuilder; private $cookieMetadataFactory; - const COOKIE_NAME = 'nosto.itemsAddedToCart'; + public const COOKIE_NAME = 'nosto.itemsAddedToCart'; /** * Constructor. diff --git a/Setup/Core.php b/Setup/Core.php index 2140ae9e1..722b8e0a3 100644 --- a/Setup/Core.php +++ b/Setup/Core.php @@ -47,10 +47,10 @@ abstract class Core { - const PRODUCT_DATA_MAX_LENGTH = '32M'; + public const PRODUCT_DATA_MAX_LENGTH = '32M'; - const CL_TABLE_INDEX_PRODUCT_INVALIDATE = "nosto_index_product_invalidate_cl"; - const CL_TABLE_INDEX_PRODUCT_DATA = "nosto_index_product_data_cl"; + public const CL_TABLE_INDEX_PRODUCT_INVALIDATE = "nosto_index_product_invalidate_cl"; + public const CL_TABLE_INDEX_PRODUCT_DATA = "nosto_index_product_data_cl"; /** * Creates a table for mapping Nosto customer to Magento's cart & orders diff --git a/Setup/UpgradeSchema.php b/Setup/UpgradeSchema.php index 4ca741760..a41061e97 100755 --- a/Setup/UpgradeSchema.php +++ b/Setup/UpgradeSchema.php @@ -49,7 +49,7 @@ class UpgradeSchema extends Core implements UpgradeSchemaInterface { - const PRODUCT_QUEUE_TABLE = 'nosto_tagging_product_queue'; + public const PRODUCT_QUEUE_TABLE = 'nosto_tagging_product_queue'; /** @var Logger $loger */ private $loger; diff --git a/Util/Customer.php b/Util/Customer.php index 16d704030..b18079dcf 100644 --- a/Util/Customer.php +++ b/Util/Customer.php @@ -41,7 +41,7 @@ class Customer { - const CUSTOMER_REFERENCE_HASH_ALGO = 'sha256'; + public const CUSTOMER_REFERENCE_HASH_ALGO = 'sha256'; /** * @param CustomerInterface|CustomerInterceptor $customer @@ -54,4 +54,4 @@ public static function generateCustomerReference($customer) $customer->getId() . $customer->getEmail() ); } -} \ No newline at end of file +}