Skip to content

Commit

Permalink
CC-13273: Display numbers in Zed based on the current user locale. (#…
Browse files Browse the repository at this point in the history
…8889)

CC-13273: Display numbers in Zed for users.
  • Loading branch information
romanhavrylko authored Sep 19, 2022
1 parent dc76442 commit c6feae7
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 21 deletions.
14 changes: 0 additions & 14 deletions architecture-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
"ruleset": "Spryker",
"priority": "2"
},
{
"fileName": "src/Spryker/Zed/ContentProductGui/Dependency/Facade/ContentProductGuiToLocaleInterface.php",
"description": "Bridges: The bridge interface has incorrect method signature for `getCurrentLocale()`. Missed return type. That violates the rule \"All bridge interface methods must have exactly the same or more strict signature as their parent\"",
"rule": "BridgeMethodsInterfaceRule",
"ruleset": "Spryker",
"priority": "2"
},
{
"fileName": "src/Spryker/Zed/ContentProductGui/Dependency/Facade/ContentProductGuiToProductImageBridge.php",
"description": "Bridges: Type should be defined for param `idProductAbstract` in method `Spryker\\Zed\\ContentProductGui\\Dependency\\Facade\\ContentProductGuiToProductImageBridge::getProductImagesSetCollectionByProductAbstractId()`.",
Expand All @@ -26,12 +19,5 @@
"rule": "BridgeFacadeMethodsRule",
"ruleset": "Spryker",
"priority": "2"
},
{
"fileName": "src/Spryker/Zed/ContentProductGui/Dependency/Facade/ContentProductGuiToProductImageInterface.php",
"description": "Bridges: The bridge interface has incorrect method signature for `getProductImagesSetCollectionByProductAbstractId()`. Missed return type. That violates the rule \"All bridge interface methods must have exactly the same or more strict signature as their parent\"",
"rule": "BridgeMethodsInterfaceRule",
"ruleset": "Spryker",
"priority": "2"
}
]
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"php": ">=7.4",
"spryker/content-gui-extension": "^1.1.0",
"spryker/content-product": "^1.0.0",
"spryker/gui": "^3.17.0",
"spryker/gui": "^3.45.0",
"spryker/kernel": "^3.30.0",
"spryker/locale": "^3.0.0",
"spryker/product": "^6.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected function formatRow(SpyProductAbstract $productAbstractEntity): array
$idProductAbstract = $productAbstractEntity->getIdProductAbstract();

return [
static::COL_ID_PRODUCT_ABSTRACT => $idProductAbstract,
static::COL_ID_PRODUCT_ABSTRACT => $this->formatInt($idProductAbstract),
static::COL_SKU => $productAbstractEntity->getSku(),
static::COL_IMAGE => $this->getProductPreview($this->getProductPreviewUrl($productAbstractEntity)),
static::COL_NAME => $productAbstractEntity->getSpyProductAbstractLocalizedAttributess()->getFirst()->getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected function formatRow(SpyProductAbstract $productAbstractEntity): array
$idProductAbstract = $productAbstractEntity->getIdProductAbstract();

return [
static::COL_ID_PRODUCT_ABSTRACT => $idProductAbstract,
static::COL_ID_PRODUCT_ABSTRACT => $this->formatInt($idProductAbstract),
static::COL_SKU => $productAbstractEntity->getSku(),
static::COL_IMAGE => $this->getProductPreview($this->getProductPreviewUrl($productAbstractEntity)),
static::COL_NAME => $productAbstractEntity->getSpyProductAbstractLocalizedAttributess()->getFirst()->getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace Spryker\Zed\ContentProductGui\Dependency\Facade;

use Generated\Shared\Transfer\LocaleTransfer;

class ContentProductGuiToLocaleBridge implements ContentProductGuiToLocaleInterface
{
/**
Expand All @@ -25,7 +27,7 @@ public function __construct($localeFacade)
/**
* @return \Generated\Shared\Transfer\LocaleTransfer
*/
public function getCurrentLocale()
public function getCurrentLocale(): LocaleTransfer
{
return $this->localeFacade->getCurrentLocale();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

namespace Spryker\Zed\ContentProductGui\Dependency\Facade;

use Generated\Shared\Transfer\LocaleTransfer;

interface ContentProductGuiToLocaleInterface
{
/**
* @return \Generated\Shared\Transfer\LocaleTransfer
*/
public function getCurrentLocale();
public function getCurrentLocale(): LocaleTransfer;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct($productImageFacade)
*
* @return array<\Generated\Shared\Transfer\ProductImageSetTransfer>
*/
public function getProductImagesSetCollectionByProductAbstractId($idProductAbstract)
public function getProductImagesSetCollectionByProductAbstractId($idProductAbstract): array
{
return $this->productImageFacade->getProductImagesSetCollectionByProductAbstractId($idProductAbstract);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ interface ContentProductGuiToProductImageInterface
*
* @return array<\Generated\Shared\Transfer\ProductImageSetTransfer>
*/
public function getProductImagesSetCollectionByProductAbstractId($idProductAbstract);
public function getProductImagesSetCollectionByProductAbstractId($idProductAbstract): array;
}

0 comments on commit c6feae7

Please sign in to comment.