Skip to content

Commit

Permalink
TE-9806 Improve CS by adding const docblocks with var type (#8694)
Browse files Browse the repository at this point in the history
TE-9806 Const docblock sniff
  • Loading branch information
dereuromark authored Sep 7, 2021
1 parent f4d2326 commit ace225c
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

class ProductListKeyGenerator implements ProductListKeyGeneratorInterface
{
/**
* @var string
*/
protected const PRODUCT_LIST_KEY_PATTERN = '%s-%d';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class ProductListWriter implements ProductListWriterInterface
{
use TransactionTrait;

/**
* @var string
*/
protected const MESSAGE_PRODUCT_LIST_DELETE_SUCCESS = 'Product List has been successfully removed.';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@

class ProductListRestrictionValidator implements ProductListRestrictionValidatorInterface
{
/**
* @var string
*/
protected const MESSAGE_PARAM_SKU = '%sku%';
/**
* @var string
*/
protected const MESSAGE_INFO_RESTRICTED_PRODUCT_REMOVED = 'product-cart.info.restricted-product.removed';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@

class RestrictedItemsFilter implements RestrictedItemsFilterInterface
{
/**
* @var string
*/
protected const MESSAGE_PARAM_SKU = '%sku%';
/**
* @var string
*/
protected const MESSAGE_INFO_RESTRICTED_PRODUCT_REMOVED = 'product-cart.info.restricted-product.removed';

/**
Expand Down
15 changes: 15 additions & 0 deletions src/Spryker/Zed/ProductList/Dependency/ProductListEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface ProductListEvents
* - This event is used for spy_product_list publishing.
*
* @api
* @var string
*/
public const PRODUCT_LIST_PUBLISH = 'ProductList.spy_product_list.publish';

Expand All @@ -22,6 +23,7 @@ interface ProductListEvents
* - This event is used for spy_product_list unpublishing.
*
* @api
* @var string
*/
public const PRODUCT_LIST_UNPUBLISH = 'ProductList.spy_product_list.unpublish';

Expand All @@ -30,6 +32,7 @@ interface ProductListEvents
* - This event is used for spy_product_list entity creation
*
* @api
* @var string
*/
public const ENTITY_SPY_PRODUCT_LIST_CREATE = 'Entity.spy_product_list.create';

Expand All @@ -38,6 +41,7 @@ interface ProductListEvents
* - This event is used for spy_product_list entity changes
*
* @api
* @var string
*/
public const ENTITY_SPY_PRODUCT_LIST_UPDATE = 'Entity.spy_product_list.update';

Expand All @@ -46,6 +50,7 @@ interface ProductListEvents
* - This event is used for spy_product_list entity deletion
*
* @api
* @var string
*/
public const ENTITY_SPY_PRODUCT_LIST_DELETE = 'Entity.spy_product_list.delete';

Expand All @@ -54,6 +59,7 @@ interface ProductListEvents
* - This event is used for spy_product_list_product_concrete publishing.
*
* @api
* @var string
*/
public const PRODUCT_LIST_PRODUCT_CONCRETE_PUBLISH = 'ProductList.spy_product_list_product_concrete.publish';

Expand All @@ -62,6 +68,7 @@ interface ProductListEvents
* - This event is used for spy_product_list_product_concrete unpublishing.
*
* @api
* @var string
*/
public const PRODUCT_LIST_PRODUCT_CONCRETE_UNPUBLISH = 'ProductList.spy_product_list_product_concrete.unpublish';

Expand All @@ -70,6 +77,7 @@ interface ProductListEvents
* - This event is used for spy_product_list_product_concrete entity creation
*
* @api
* @var string
*/
public const ENTITY_SPY_PRODUCT_LIST_PRODUCT_CONCRETE_CREATE = 'Entity.spy_product_list_product_concrete.create';

Expand All @@ -78,6 +86,7 @@ interface ProductListEvents
* - This event is used for spy_product_list_product_concrete entity changes
*
* @api
* @var string
*/
public const ENTITY_SPY_PRODUCT_LIST_PRODUCT_CONCRETE_UPDATE = 'Entity.spy_product_list_product_concrete.update';

Expand All @@ -86,6 +95,7 @@ interface ProductListEvents
* - This event is used for spy_product_list_product_concrete entity deletion
*
* @api
* @var string
*/
public const ENTITY_SPY_PRODUCT_LIST_PRODUCT_CONCRETE_DELETE = 'Entity.spy_product_list_product_concrete.delete';

Expand All @@ -94,6 +104,7 @@ interface ProductListEvents
* - This event is used for spy_product_list_category publishing.
*
* @api
* @var string
*/
public const PRODUCT_LIST_CATEGORY_PUBLISH = 'ProductList.spy_product_list_category.publish';

Expand All @@ -102,6 +113,7 @@ interface ProductListEvents
* - This event is used for spy_product_list_category unpublishing.
*
* @api
* @var string
*/
public const PRODUCT_LIST_CATEGORY_UNPUBLISH = 'ProductList.spy_product_list_category.unpublish';

Expand All @@ -110,6 +122,7 @@ interface ProductListEvents
* - This event is used for spy_product_list_category entity creation
*
* @api
* @var string
*/
public const ENTITY_SPY_PRODUCT_LIST_CATEGORY_CREATE = 'Entity.spy_product_list_category.create';

Expand All @@ -118,6 +131,7 @@ interface ProductListEvents
* - This event is used for spy_product_list_category entity changes
*
* @api
* @var string
*/
public const ENTITY_SPY_PRODUCT_LIST_CATEGORY_UPDATE = 'Entity.spy_product_list_category.update';

Expand All @@ -126,6 +140,7 @@ interface ProductListEvents
* - This event is used for spy_product_list_category entity deletion
*
* @api
* @var string
*/
public const ENTITY_SPY_PRODUCT_LIST_CATEGORY_DELETE = 'Entity.spy_product_list_category.delete';
}
12 changes: 12 additions & 0 deletions src/Spryker/Zed/ProductList/Persistence/ProductListRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,21 @@
*/
class ProductListRepository extends AbstractRepository implements ProductListRepositoryInterface
{
/**
* @var string
*/
public const COL_CONCRETE_PRODUCT_COUNT = 'concrete_product_count';
/**
* @var string
*/
public const COL_ID_PRODUCT_ABSTRACT = 'col_id_product_abstract';
/**
* @var string
*/
public const COL_TYPE = 'col_type';
/**
* @var string
*/
public const COL_ID_PRODUCT_LIST = 'col_id_product_list';

/**
Expand Down
18 changes: 18 additions & 0 deletions src/Spryker/Zed/ProductList/ProductListDependencyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,31 @@
*/
class ProductListDependencyProvider extends AbstractBundleDependencyProvider
{
/**
* @var string
*/
public const SERVICE_UTIL_TEXT = 'SERVICE_UTIL_TEXT';

/**
* @var string
*/
public const FACADE_MESSENGER = 'FACADE_MESSENGER';
/**
* @var string
*/
public const FACADE_PRODUCT = 'FACADE_PRODUCT';

/**
* @var string
*/
public const PLUGINS_PRODUCT_LIST_PRE_CREATE = 'PLUGINS_PRODUCT_LIST_PRE_CREATE';
/**
* @var string
*/
public const PLUGINS_PRODUCT_LIST_PRE_UPDATE = 'PLUGINS_PRODUCT_LIST_PRE_UPDATE';
/**
* @var string
*/
public const PLUGINS_PRODUCT_LIST_DELETE_PRE_CHECK = 'PLUGINS_PRODUCT_LIST_DELETE_PRE_CHECK';

/**
Expand Down

0 comments on commit ace225c

Please sign in to comment.