Skip to content

Commit

Permalink
Merge branch 'phpstan'
Browse files Browse the repository at this point in the history
  • Loading branch information
netzkollektiv committed Aug 3, 2023
2 parents edad5f6 + 0089248 commit f2f8be7
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- 'main'
- 'automate'
- 'phpstan'

jobs:
ci-current:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
class ItemBuilder
{
private $db;
private $rawItem;

private $categoryId;
private $articleId;
private $product;

private $categoryName;

Expand Down
7 changes: 5 additions & 2 deletions src/Frontend/NetzkollektivEasyCredit/Api/QuoteBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ public function getIsClickAndCollect() {

public function getGrandTotal() {
if ($this->grandTotal === null) {
/** @var Shopware_Controllers_Frontend_Checkout $checkoutController */
$basket = (new FakeCheckoutController())->setFront(Shopware()->Front())->getBasket();
/** @var \Shopware_Controllers_Frontend_Checkout $checkoutController */
$checkoutController = new FakeCheckoutController();
$checkoutController->setFront(Shopware()->Front());

$basket = $checkoutController->getBasket();
$this->grandTotal = empty($basket['AmountWithTaxNumeric']) ? $basket['AmountNumeric'] : $basket['AmountWithTaxNumeric'];
}
return $this->grandTotal;
Expand Down
2 changes: 0 additions & 2 deletions src/Frontend/NetzkollektivEasyCredit/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ public function afterInit()
/**
* Activate the plugin easycredit plugin.
* Sets the active flag in the payment row.
*
* @return bool
*/
public function enable()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
abstract class Shopware_Controllers_Backend_EasycreditMerchant_Abstract extends Shopware_Controllers_Backend_Application {

/**
* @var string
* {@inheritdoc}
*/
protected $model = Order::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ protected function getRedirectUrl() {
if ($e->getResponseObject() instanceof PaymentConstraintViolation) {
$errors = [];
foreach ($e->getResponseObject()->getViolations() as $violation) {
$errors[$violation['field']] = $violation['messageDE'] ?? $violation['message'];
$errors[$violation->getField()] = $violation->getMessageDE() ? $violation->getMessageDE() : $violation->getMessage();
}
if (in_array('orderDetails.invoiceAddress', array_keys($errors)) ||
in_array('orderDetails.shippingAddress', array_keys($errors))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function _onOrderStatusChanged(PreUpdateEventArgs $eventArgs) {
if ($e->getResponseObject() instanceof ConstraintViolation) {
$error = 'easyCredit-Ratenkauf: ';
foreach ($e->getResponseObject()->getViolations() as $violation) {
$error .= $violation['message'];
$error .= $violation->getMessage();
}
return $this->handleError($error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function _onOrderStatusChanged(PreUpdateEventArgs $eventArgs) {
if ($e->getResponseObject() instanceof ConstraintViolation) {
$error = 'easyCredit-Ratenkauf: ';
foreach ($e->getResponseObject()->getViolations() as $violation) {
$error .= $violation['message'];
$error .= $violation->getMessage();
}
return $this->handleError($error);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Frontend/NetzkollektivEasyCredit/phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
checkMissingIterableValueType: false
reportUnmatchedIgnoredErrors: false
level: 2
level: 3
scanDirectories:
- vendor
- ../../../../../../vendor
Expand Down

0 comments on commit f2f8be7

Please sign in to comment.