Skip to content
Code-Schnipsel Gruppen Projekte
Commit e8c4d77c erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

refactor(phpstan): change order interface to erp entity interface in Discount

Updated the 'canUsedInOrder' function in Discount.php to accept ERP Entity Interface arguments
instead of Order Interfaces for better flexibility and compatibility. Added checks to ensure that
the provided entity is an instance of the Order Interface, increasing robustness.
Übergeordneter 6100708f
Branches main
Tags 2.0.3
2 Merge Requests!13Update 'next-3.x' with latest changes from 'main',!12fix(phpstan): improved method validity checks and reduced error handling
Pipeline #15002 bestanden mit Phase
in 2 Minuten und 7 Sekunden
......@@ -437,15 +437,23 @@ public function canUsedWith(QUI\ERP\Products\Interfaces\ProductInterface $Produc
}
/**
* @param OrderInterface $Order
* @param QUI\ERP\ErpEntityInterface $Order
* @return bool
*/
public function canUsedInOrder(OrderInterface $Order): bool
public function canUsedInOrder(QUI\ERP\ErpEntityInterface $Order): bool
{
if ($this->isActive() === false) {
return false;
}
if (!interface_exists('QUI\ERP\Order\OrderInterface')) {
return false;
}
if (!($Order instanceof QUI\ERP\Order\OrderInterface)) {
return false;
}
$Articles = $Order->getArticles();
foreach ($Articles as $Article) {
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren