diff --git a/src/CoreShop/Bundle/CoreBundle/Controller/CoreSaleCreationTrait.php b/src/CoreShop/Bundle/CoreBundle/Controller/CoreSaleCreationTrait.php index 57a55b1843..d926cc1775 100644 --- a/src/CoreShop/Bundle/CoreBundle/Controller/CoreSaleCreationTrait.php +++ b/src/CoreShop/Bundle/CoreBundle/Controller/CoreSaleCreationTrait.php @@ -78,13 +78,8 @@ public function getCarrierDetails(CartInterface $cart) $price = $this->get('coreshop.carrier.price_calculator.taxed')->getPrice( $carrier, $cart, - $cart->getShippingAddress() - ); - $priceConverted = $this->get('coreshop.currency_converter')->convert( - $price, - $currentCurrency, - $cart->getCurrency()->getIsoCode() - ); + $cart->getShippingAddress() + ); $result[] = [ 'id' => $carrier->getId(), diff --git a/src/CoreShop/Bundle/FrontendBundle/Controller/SearchController.php b/src/CoreShop/Bundle/FrontendBundle/Controller/SearchController.php index 7489cdc6ba..acda731850 100644 --- a/src/CoreShop/Bundle/FrontendBundle/Controller/SearchController.php +++ b/src/CoreShop/Bundle/FrontendBundle/Controller/SearchController.php @@ -70,7 +70,7 @@ public function searchAction(Request $request) protected function createSearchForm() { - return $form = $this->get('form.factory')->createNamed('search', SearchType::class, null, [ + return $this->get('form.factory')->createNamed('search', SearchType::class, null, [ 'action' => $this->generateCoreShopUrl(null, 'coreshop_search'), 'method' => 'GET', ]); diff --git a/src/CoreShop/Bundle/IndexBundle/Worker/AbstractWorker.php b/src/CoreShop/Bundle/IndexBundle/Worker/AbstractWorker.php index b0ac3e7f21..682b3f43d5 100644 --- a/src/CoreShop/Bundle/IndexBundle/Worker/AbstractWorker.php +++ b/src/CoreShop/Bundle/IndexBundle/Worker/AbstractWorker.php @@ -303,7 +303,6 @@ protected function processGetter(IndexColumnInterface $column, IndexableInterfac { $getter = $column->getGetter(); $getterClass = $this->getterServiceRegistry->get($getter); - $value = null; Assert::isInstanceOf($getterClass, GetterInterface::class); diff --git a/src/CoreShop/Bundle/IndexBundle/Worker/MysqlWorker.php b/src/CoreShop/Bundle/IndexBundle/Worker/MysqlWorker.php index 237e7729b5..99212e8d91 100644 --- a/src/CoreShop/Bundle/IndexBundle/Worker/MysqlWorker.php +++ b/src/CoreShop/Bundle/IndexBundle/Worker/MysqlWorker.php @@ -300,7 +300,7 @@ protected function typeCastValueSQLDecleration(IndexColumnInterface $column) */ protected function handleArrayValues(IndexInterface $index, array $value) { - return ',' . implode($value, ',') . ','; + return ',' . implode(',', $value) . ','; } /** diff --git a/src/CoreShop/Bundle/OrderBundle/Controller/AbstractCartCreationController.php b/src/CoreShop/Bundle/OrderBundle/Controller/AbstractCartCreationController.php index 85ec46d067..b815248fb8 100644 --- a/src/CoreShop/Bundle/OrderBundle/Controller/AbstractCartCreationController.php +++ b/src/CoreShop/Bundle/OrderBundle/Controller/AbstractCartCreationController.php @@ -187,7 +187,6 @@ protected function prepareCartItem(CartInterface $cart, CartItemInterface $item) $currency = $cart->getStore()->getCurrency()->getIsoCode(); $moneyConverter = $this->get('coreshop.currency_converter'); - $moneyFormatter = $this->get('coreshop.money_formatter'); $price = $item->getItemPrice(); $total = $item->getTotal(); diff --git a/src/CoreShop/Bundle/OrderBundle/Pimcore/Repository/CartRepository.php b/src/CoreShop/Bundle/OrderBundle/Pimcore/Repository/CartRepository.php index bc86fde9fc..4dadd60f98 100644 --- a/src/CoreShop/Bundle/OrderBundle/Pimcore/Repository/CartRepository.php +++ b/src/CoreShop/Bundle/OrderBundle/Pimcore/Repository/CartRepository.php @@ -126,7 +126,7 @@ public function findExpiredCarts($days, $anonymous, $customer) $params = []; $daysTimestamp = Carbon::now(); - $daysTimestamp->subDay($days); + $daysTimestamp->subDays($days); $conditions[] = 'o_creationDate < ?'; $params[] = $daysTimestamp->getTimestamp(); diff --git a/src/CoreShop/Bundle/TrackingBundle/Tracker/Matomo/Matomo.php b/src/CoreShop/Bundle/TrackingBundle/Tracker/Matomo/Matomo.php index 92ff337224..1a10cd8682 100644 --- a/src/CoreShop/Bundle/TrackingBundle/Tracker/Matomo/Matomo.php +++ b/src/CoreShop/Bundle/TrackingBundle/Tracker/Matomo/Matomo.php @@ -203,8 +203,6 @@ private function filterCategories($categories, int $limit = 5) return $categories; } - $result = null; - if (is_array($categories)) { // add max 5 categories $categories = array_slice($categories, 0, 5); diff --git a/src/CoreShop/Component/Address/Context/RequestBased/GeoLiteBasedRequestResolver.php b/src/CoreShop/Component/Address/Context/RequestBased/GeoLiteBasedRequestResolver.php index 533024cc28..7d360c6a71 100644 --- a/src/CoreShop/Component/Address/Context/RequestBased/GeoLiteBasedRequestResolver.php +++ b/src/CoreShop/Component/Address/Context/RequestBased/GeoLiteBasedRequestResolver.php @@ -39,7 +39,6 @@ public function __construct(CountryRepositoryInterface $countryRepository) public function findCountry(Request $request) { $geoDbFile = PIMCORE_CONFIGURATION_DIRECTORY . '/GeoLite2-City.mmdb'; - $record = null; if (file_exists($geoDbFile)) { try { diff --git a/src/CoreShop/Component/Core/Notification/Rule/Action/Order/StoreMailActionProcessor.php b/src/CoreShop/Component/Core/Notification/Rule/Action/Order/StoreMailActionProcessor.php index 2dbfea4cab..7c265954a5 100644 --- a/src/CoreShop/Component/Core/Notification/Rule/Action/Order/StoreMailActionProcessor.php +++ b/src/CoreShop/Component/Core/Notification/Rule/Action/Order/StoreMailActionProcessor.php @@ -38,7 +38,6 @@ public function __construct(MailActionProcessor $mailActionProcessor) */ public function apply($subject, NotificationRuleInterface $rule, array $configuration, $params = []) { - $language = null; $store = null; $mails = $configuration['mails']; diff --git a/src/CoreShop/Component/Core/Notification/Rule/Action/Order/StoreOrderMailActionProcessor.php b/src/CoreShop/Component/Core/Notification/Rule/Action/Order/StoreOrderMailActionProcessor.php index 3790b7d9db..cfa40c1d6c 100644 --- a/src/CoreShop/Component/Core/Notification/Rule/Action/Order/StoreOrderMailActionProcessor.php +++ b/src/CoreShop/Component/Core/Notification/Rule/Action/Order/StoreOrderMailActionProcessor.php @@ -37,7 +37,6 @@ public function __construct(OrderMailActionProcessor $orderMailActionProcessor) */ public function apply($subject, NotificationRuleInterface $rule, array $configuration, $params = []) { - $language = null; $store = null; $mails = $configuration['mails']; diff --git a/src/CoreShop/Component/Core/Order/Transformer/CartItemToSaleItemTransformer.php b/src/CoreShop/Component/Core/Order/Transformer/CartItemToSaleItemTransformer.php index dddce5afb0..650cfdde79 100644 --- a/src/CoreShop/Component/Core/Order/Transformer/CartItemToSaleItemTransformer.php +++ b/src/CoreShop/Component/Core/Order/Transformer/CartItemToSaleItemTransformer.php @@ -47,7 +47,6 @@ public function transform(ProposalInterface $proposal, ProposalItemInterface $fr if ($fromProposalItem instanceof CartItemInterface && $toProposal instanceof SaleItemInterface) { $toProposal->setDigitalProduct($fromProposalItem->getDigitalProduct()); $toProposal->setObjectId($fromProposalItem->getProduct()->getId()); - $mainObjectId = null; if ($fromProposalItem->getProduct() instanceof ProductInterface) { if ($fromProposalItem->getProduct()->getType() === AbstractObject::OBJECT_TYPE_VARIANT) { diff --git a/src/CoreShop/Component/Core/Product/Calculator/StoreProductUnitDefinitionPriceCalculator.php b/src/CoreShop/Component/Core/Product/Calculator/StoreProductUnitDefinitionPriceCalculator.php index c19cee4217..ec63fb3395 100644 --- a/src/CoreShop/Component/Core/Product/Calculator/StoreProductUnitDefinitionPriceCalculator.php +++ b/src/CoreShop/Component/Core/Product/Calculator/StoreProductUnitDefinitionPriceCalculator.php @@ -35,8 +35,6 @@ public function getRetailPrice(ProductInterface $subject, array $context) Assert::keyExists($context, 'store'); Assert::isInstanceOf($context['store'], StoreInterface::class); - $price = null; - if (!isset($context['unitDefinition']) || !$context['unitDefinition'] instanceof ProductUnitDefinitionInterface) { throw new NoRetailPriceFoundException(__CLASS__); } diff --git a/src/CoreShop/Component/Pimcore/DataObject/ClassInstaller.php b/src/CoreShop/Component/Pimcore/DataObject/ClassInstaller.php index ebb2c5b585..2a20ba3ac7 100644 --- a/src/CoreShop/Component/Pimcore/DataObject/ClassInstaller.php +++ b/src/CoreShop/Component/Pimcore/DataObject/ClassInstaller.php @@ -21,11 +21,10 @@ class ClassInstaller implements ClassInstallerInterface */ public function createBrick($jsonFile, $brickName) { - $objectBrick = null; - try { $objectBrick = DataObject\Objectbrick\Definition::getByKey($brickName); } catch (\Exception $e) { + $objectBrick = null; } if (null === $objectBrick) { @@ -97,11 +96,10 @@ public function createClass($jsonFile, $className, $updateClass = false) */ public function createFieldCollection($jsonFile, $name) { - $fieldCollection = null; - try { $fieldCollection = DataObject\Fieldcollection\Definition::getByKey($name); } catch (\Exception $e) { + $fieldCollection = null; } if (null === $fieldCollection) { diff --git a/src/CoreShop/Component/Resource/DataHub/DoctrineProvider.php b/src/CoreShop/Component/Resource/DataHub/DoctrineProvider.php index 49a1022d33..40adb2617f 100644 --- a/src/CoreShop/Component/Resource/DataHub/DoctrineProvider.php +++ b/src/CoreShop/Component/Resource/DataHub/DoctrineProvider.php @@ -117,7 +117,7 @@ public function initializeObjectType(ClassMetadataInfo $entityMetaType) foreach ($entityMetaType->getFieldNames() as $fieldName) { $fieldType = $this->mapFieldType($entityMetaType->getTypeOfField($fieldName)); - $resolverClass = null; + $resolver = new DoctrineField($fieldName, $fieldType); $fields[$fieldName] = $resolver->getDefinition(); $inputFields[$fieldName] = array(