Skip to content

Commit ebd9a89

Browse files
committed
Fix CI
1 parent 6990227 commit ebd9a89

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

src/Controller/AddToCartController.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,27 @@
55
namespace Omikron\FactFinder\Oxid\Controller;
66

77
use OxidEsales\Eshop\Application\Controller\FrontendController;
8-
use OxidEsales\Eshop\Core\Registry;
9-
use OxidEsales\Eshop\Application\Model\Basket;
108
use OxidEsales\Eshop\Application\Model\Article;
9+
use OxidEsales\Eshop\Core\Registry;
1110

1211
class AddToCartController extends FrontendController
1312
{
1413
public function addToCart(): void
1514
{
1615
$productNumber = Registry::getRequest()->getRequestParameter('productNumber');
17-
$amount = 1;
18-
$utilsView = Registry::getUtilsView();
16+
$amount = 1;
17+
$utilsView = Registry::getUtilsView();
1918

2019
try {
2120
if (!$productNumber) {
22-
throw new \Exception('Product with number ' . $productNumber . ' does not exist');
21+
throw new \Exception("Product with number $productNumber does not exist");
2322
}
2423

25-
$product = oxNew(Article::class);
24+
$product = oxNew(Article::class);
2625
$productId = $this->getProductIdByNumber($productNumber);
2726

2827
if (!$productId || !$product->load($productId) || !$product->isBuyable()) {
29-
throw new \Exception('Product with number ' . $productNumber . ' does not exist or is not buyable');
28+
throw new \Exception("Product with number $productNumber does not exist or is not buyable");
3029
}
3130

3231
$basket = Registry::getSession()->getBasket();
@@ -42,10 +41,10 @@ public function addToCart(): void
4241

4342
private function getProductIdByNumber($productNumber)
4443
{
45-
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
46-
$sQuery = "SELECT oxid FROM oxarticles WHERE oxartnum = ? AND oxactive = 1";
44+
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
45+
$sQuery = 'SELECT oxid FROM oxarticles WHERE oxartnum = ? AND oxactive = 1';
4746

48-
return $db->getOne($sQuery, [$productNumber]);
47+
return $database->getOne($sQuery, [$productNumber]);
4948
}
5049

5150
private function redirectToReferer(): void

0 commit comments

Comments
 (0)