Skip to content

Commit 406925f

Browse files
committed
Merge pull request #7863 in SW/shopware from ntr/5.6/add-deprecation-notice to 5.6
* commit '143ff9ac005e0ad2952ad901e240397dc1df8dce': NTR - Add deprecation notice for `\Shopware\Bundle\StoreFrontBundle\Gateway\DBAL\CategoryGateway::get` with an array of ids
2 parents d7f2db9 + 143ff9a commit 406925f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/CategoryGateway.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@ public function __construct(
8181
public function get($id, Struct\ShopContextInterface $context)
8282
{
8383
/*
84-
* @deprecated since 5.5, will be removed in Shopware 5.6
84+
* @deprecated since 5.5, will be removed in Shopware 5.7
8585
*
86-
* Allowing an array as a parameter is supported in 5.5.x for legacy reasons.
87-
* The check below will be removed in Shopware 5.6
86+
* Allowing an array as a parameter is supported in 5.5/5.6 for legacy reasons.
87+
* The check below will be removed in Shopware 5.7
8888
*/
8989
if (is_array($id)) {
90+
trigger_error(sprintf('Calling %s:%s with an array of Ids is deprecated since Shopware 5.5 and will crash with 5.7. Use a single int Id instead.', __CLASS__, __METHOD__), E_USER_DEPRECATED);
91+
9092
$id = $id[0];
9193
}
9294
$categories = $this->getList([$id], $context);

0 commit comments

Comments
 (0)