Skip to content

Commit

Permalink
Merge pull request #2256 from coreshop/coding-standard/refactor-3.0
Browse files Browse the repository at this point in the history
[CS] Refactor
  • Loading branch information
dpfaffenbauer committed Apr 24, 2023
2 parents 44fd967 + e356026 commit fb94425
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/CoreShop/Behat/Context/Setup/CartPriceRuleContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ public function addingACartPriceRule($ruleName): void
$this->sharedStorage->set('cart-price-rule', $rule);
}


/**
* @Given /^the (cart rule "[^"]+") has priority "([^"]+)"$/
* @Given /^the (cart rule) has priority "([^"]+)"$/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@

declare(strict_types=1);

/*
* CoreShop
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - CoreShop Commercial License (CCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) CoreShop GmbH (https://www.coreshop.org)
* @license https://www.coreshop.org/license GPLv3 and CCL
*
*/

namespace CoreShop\Bundle\CoreBundle\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20230418082816 extends AbstractMigration
{
public function getDescription(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getAddress(array $context = []): ?AddressInterface
{
if (array_key_exists('cart', $context) && $context['cart'] instanceof OrderInterface) {
$invoiceAddress = $context['cart']->getInvoiceAddress();
if ( $invoiceAddress instanceof AddressInterface ) {
if ($invoiceAddress instanceof AddressInterface) {
return $invoiceAddress;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function isCartRuleValid(
OrderInterface $cart,
CartPriceRuleInterface $cartPriceRule,
?CartPriceRuleVoucherCodeInterface $voucher,
array $configuration
array $configuration,
): bool {
if (!$cart->hasPriceRules()) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
namespace CoreShop\Component\Pimcore\Slug;

use CoreShop\Component\Pimcore\DataObject\InheritanceHelper;
use Pimcore\Model\DataObject\AbstractObject;
use Pimcore\Model\DataObject\Concrete;
use Pimcore\Model\DataObject\Data\UrlSlug;
use Pimcore\Model\Site;
Expand Down Expand Up @@ -69,7 +68,7 @@ public function generateSlugs(SluggableInterface $sluggable): void
} else {
// $existingSlug is the slug to be saved from backend
$dbSlug = null;
if($sluggable instanceof Concrete) {
if ($sluggable instanceof Concrete) {
/** @psalm-suppress InternalMethod */
$dbSlug = $sluggable->retrieveSlugData(['fieldname' => 'slug', 'ownertype' => 'object', 'position' => $language, 'siteId' => $existingSlug->getSiteId()])[0]['slug'] ?? null;
if ($dbSlug === null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ public function isShippingRuleValid(CarrierInterface $carrier, ShippableInterfac

if ($total) {
$totalAmount = $shippable->getTotal($gross) - $shippable->getShipping($gross);
}
else {
} else {
$totalAmount = $shippable->getSubtotal($gross);
}

Expand Down

0 comments on commit fb94425

Please sign in to comment.