Skip to content

Commit 1499724

Browse files
authored
Merge pull request #276 from extcode/fix-cgl
[BUGFIX] Fix CI pipelines
2 parents 71e09b0 + 7607a94 commit 1499724

File tree

15 files changed

+79
-79
lines changed

15 files changed

+79
-79
lines changed

Classes/Controller/ProductController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ protected function createDemandObjectFromSettings(array $settings): ProductDeman
8282
}
8383
if ($settings['orderBy']) {
8484
if (
85-
!isset($settings['orderDirection']) &&
86-
$settings['orderDirection'] !== 'DESC'
85+
!isset($settings['orderDirection'])
86+
&& $settings['orderDirection'] !== 'DESC'
8787
) {
8888
$settings['orderDirection'] = 'ASC';
8989
}

Classes/Domain/Model/Product/BeVariant.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public function getPriceCalculated(): float
9898
};
9999

100100
if (
101-
isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['changeVariantDiscount']) &&
102-
is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['changeVariantDiscount'])
101+
isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['changeVariantDiscount'])
102+
&& is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['changeVariantDiscount'])
103103
) {
104104
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['changeVariantDiscount'] as $funcRef) {
105105
if ($funcRef) {
@@ -144,8 +144,8 @@ public function getBestPriceCalculated($frontendUserGroupIds = []): float
144144
};
145145

146146
if (
147-
isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['changeVariantDiscount']) &&
148-
is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['changeVariantDiscount'])
147+
isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['changeVariantDiscount'])
148+
&& is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['changeVariantDiscount'])
149149
) {
150150
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['changeVariantDiscount'] as $funcRef) {
151151
if ($funcRef) {
@@ -226,8 +226,8 @@ public function getBestSpecialPrice(array $frontendUserGroupIds = []): ?SpecialP
226226

227227
foreach ($this->getSpecialPrices() as $specialPrice) {
228228
if ($bestSpecialPrice === null) {
229-
if (!$specialPrice->getFrontendUserGroup() ||
230-
in_array($specialPrice->getFrontendUserGroup()->getUid(), $frontendUserGroupIds)
229+
if (!$specialPrice->getFrontendUserGroup()
230+
|| in_array($specialPrice->getFrontendUserGroup()->getUid(), $frontendUserGroupIds)
231231
) {
232232
$bestSpecialPrice = $specialPrice;
233233
}
@@ -236,16 +236,16 @@ public function getBestSpecialPrice(array $frontendUserGroupIds = []): ?SpecialP
236236

237237
if (
238238
(
239-
($specialPrice->getPrice() < $bestSpecialPrice->getPrice()) &&
240-
in_array($this->priceCalcMethod, [0, 1, 4, 5])
241-
) ||
242-
(
243-
($specialPrice->getPrice() > $bestSpecialPrice->getPrice()) &&
244-
in_array($this->priceCalcMethod, [2, 3])
239+
($specialPrice->getPrice() < $bestSpecialPrice->getPrice())
240+
&& in_array($this->priceCalcMethod, [0, 1, 4, 5])
241+
)
242+
|| (
243+
($specialPrice->getPrice() > $bestSpecialPrice->getPrice())
244+
&& in_array($this->priceCalcMethod, [2, 3])
245245
)
246246
) {
247-
if (!$specialPrice->getFrontendUserGroup() ||
248-
in_array($specialPrice->getFrontendUserGroup()->getUid(), $frontendUserGroupIds)
247+
if (!$specialPrice->getFrontendUserGroup()
248+
|| in_array($specialPrice->getFrontendUserGroup()->getUid(), $frontendUserGroupIds)
249249
) {
250250
$bestSpecialPrice = $specialPrice;
251251
}
@@ -263,12 +263,12 @@ public function getBestPrice(array $frontendUserGroupIds = []): float
263263
if ($bestSpecialPrice) {
264264
if (
265265
(
266-
($bestSpecialPrice->getPrice() < $bestPrice) &&
267-
in_array($this->priceCalcMethod, [0, 1, 4, 5])
268-
) ||
269-
(
270-
($bestSpecialPrice->getPrice() > $bestPrice) &&
271-
in_array($this->priceCalcMethod, [2, 3])
266+
($bestSpecialPrice->getPrice() < $bestPrice)
267+
&& in_array($this->priceCalcMethod, [0, 1, 4, 5])
268+
)
269+
|| (
270+
($bestSpecialPrice->getPrice() > $bestPrice)
271+
&& in_array($this->priceCalcMethod, [2, 3])
272272
)
273273
) {
274274
$bestPrice = $bestSpecialPrice->getPrice();
@@ -301,9 +301,9 @@ public function getBasePrice(): ?float
301301
{
302302
//TODO: respects different measuring units between variant and product
303303
if (
304-
!$this->product ||
305-
!$this->product->getIsMeasureUnitCompatibility() ||
306-
!$this->getPriceMeasure() > 0
304+
!$this->product
305+
|| !$this->product->getIsMeasureUnitCompatibility()
306+
|| !$this->getPriceMeasure() > 0
307307
) {
308308
return null;
309309
}
@@ -424,20 +424,20 @@ public function getTitle(): string
424424
$titleArray = [];
425425

426426
if ($this->getProduct()->getBeVariantAttribute1()) {
427-
$titleArray[] =
428-
$this->getProduct()->getBeVariantAttribute1()->getTitle()
427+
$titleArray[]
428+
= $this->getProduct()->getBeVariantAttribute1()->getTitle()
429429
. ' '
430430
. $this->getBeVariantAttributeOption1()->getTitle();
431431
}
432432
if ($this->getProduct()->getBeVariantAttribute2()) {
433-
$titleArray[] =
434-
$this->getProduct()->getBeVariantAttribute2()->getTitle()
433+
$titleArray[]
434+
= $this->getProduct()->getBeVariantAttribute2()->getTitle()
435435
. ' '
436436
. $this->getBeVariantAttributeOption2()->getTitle();
437437
}
438438
if ($this->getProduct()->getBeVariantAttribute3()) {
439-
$titleArray[] =
440-
$this->getProduct()->getBeVariantAttribute3()->getTitle()
439+
$titleArray[]
440+
= $this->getProduct()->getBeVariantAttribute3()->getTitle()
441441
. ' '
442442
. $this->getBeVariantAttributeOption3()->getTitle();
443443
}

Classes/Domain/Model/Product/Product.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ public function getBestSpecialPrice(array $frontendUserGroupIds = []): float
194194
foreach ($this->specialPrices as $specialPrice) {
195195
if ($specialPrice->getPrice() < $bestSpecialPrice) {
196196
if (
197-
!$specialPrice->getFrontendUserGroup() ||
198-
in_array($specialPrice->getFrontendUserGroup()->getUid(), $frontendUserGroupIds)
197+
!$specialPrice->getFrontendUserGroup()
198+
|| in_array($specialPrice->getFrontendUserGroup()->getUid(), $frontendUserGroupIds)
199199
) {
200200
$bestSpecialPrice = $specialPrice->getPrice();
201201
}
@@ -238,8 +238,8 @@ public function getQuantityDiscountArray(array $frontendUserGroupIds = []): arra
238238

239239
if ($this->getQuantityDiscounts()) {
240240
foreach ($this->getQuantityDiscounts() as $quantityDiscount) {
241-
if (!$quantityDiscount->getFrontendUserGroup() ||
242-
in_array($quantityDiscount->getFrontendUserGroup()->getUid(), $frontendUserGroupIds)
241+
if (!$quantityDiscount->getFrontendUserGroup()
242+
|| in_array($quantityDiscount->getFrontendUserGroup()->getUid(), $frontendUserGroupIds)
243243
) {
244244
$quantityDiscountArray[] = $quantityDiscount->toArray();
245245
}

Classes/Domain/Repository/CategoryRepository.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public function findAllAsArray(?Category $selectedCategory = null): array
3131
$newCategory = [
3232
'uid' => $localCategory->getUid(),
3333
'title' => $localCategory->getTitle(),
34-
'parent' =>
35-
($localCategory->getParent() ? $localCategory->getParent()->getUid() : null),
34+
'parent'
35+
=> ($localCategory->getParent() ? $localCategory->getParent()->getUid() : null),
3636
'subcategories' => null,
3737
'isSelected' => ($selectedCategory === $localCategory),
3838
];
@@ -47,8 +47,8 @@ public function findSubcategoriesRecursiveAsArray(?Category $parentCategory = nu
4747
$localCategories = $this->findAllAsArray();
4848
foreach ($localCategories as $category) {
4949
if (
50-
!$parentCategory ||
51-
$category['uid'] === $parentCategory->getUid()
50+
!$parentCategory
51+
|| $category['uid'] === $parentCategory->getUid()
5252
) {
5353
$this->getSubcategoriesIds(
5454
$localCategories,
@@ -83,8 +83,8 @@ protected function buildSubcategories(array $categoriesArray, array $parentCateg
8383
foreach ($categoriesArray as $category) {
8484
if ($category['parent'] === $parentCategory['uid']) {
8585
$newCategory = $category;
86-
$newCategory['subcategories'] =
87-
$this->buildSubcategories($categoriesArray, $category);
86+
$newCategory['subcategories']
87+
= $this->buildSubcategories($categoriesArray, $category);
8888
$categories[] = $newCategory;
8989
}
9090
}

Classes/Domain/Repository/Product/ProductRepository.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ protected function createOrderingsFromDemand(ProductDemand $demand): array
8181
}
8282

8383
foreach ($orderList as $orderItem) {
84-
[$orderField, $orderDirection] =
85-
array_pad(
84+
[$orderField, $orderDirection]
85+
= array_pad(
8686
GeneralUtility::trimExplode(' ', $orderItem, true),
8787
2,
8888
'asc'
8989
);
9090
if (
91-
$orderDirection &&
92-
strtolower((string)$orderDirection) === 'desc'
91+
$orderDirection
92+
&& strtolower((string)$orderDirection) === 'desc'
9393
) {
9494
$orderings[$orderField] = QueryInterface::ORDER_DESCENDING;
9595
} else {

Classes/EventListener/CheckProductAvailability.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ public function checkStockForBeVariant(CartProductBeVariant $cartProductBeVarian
9393
}
9494

9595
if (
96-
$mode === 'add' &&
97-
$cart->getProductById($cartProduct->getId()) &&
98-
$cart->getProductById($cartProduct->getId())->getBeVariantById($cartProductBeVariant->getId())
96+
$mode === 'add'
97+
&& $cart->getProductById($cartProduct->getId())
98+
&& $cart->getProductById($cartProduct->getId())->getBeVariantById($cartProductBeVariant->getId())
9999
) {
100100
$quantityInCart += $cart->getProductById($cartProduct->getId())->getBeVariantById($cartProductBeVariant->getId())->getQuantity();
101101
}

Classes/EventListener/Create/CheckRequest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public function __invoke(RetrieveProductsFromRequestEvent $event): void
2222
$request = $event->getRequest();
2323

2424
if (
25-
!$request->hasArgument('product') ||
26-
!(int)$request->getArgument('product')
25+
!$request->hasArgument('product')
26+
|| !(int)$request->getArgument('product')
2727
) {
2828
$event->addError(
2929
new FlashMessage(
@@ -39,8 +39,8 @@ public function __invoke(RetrieveProductsFromRequestEvent $event): void
3939
}
4040

4141
if (
42-
!$request->hasArgument('quantity') ||
43-
$request->getArgument('quantity') < 0
42+
!$request->hasArgument('quantity')
43+
|| $request->getArgument('quantity') < 0
4444
) {
4545
$event->addError(
4646
new FlashMessage(

Classes/Hooks/DatamapDataHandlerHook.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ protected function isAllowedTargetPage($listType, $doktype)
9696
($doktype === 183) && (
9797
$listType === 'cartproducts_singleproduct'
9898
)
99-
) ||
100-
(
99+
)
100+
|| (
101101
($doktype !== 183) && (
102-
$listType === 'cartproducts_products' ||
103-
$listType === 'cartproducts_slots'
102+
$listType === 'cartproducts_products'
103+
|| $listType === 'cartproducts_slots'
104104
)
105105
)
106106
) {

Classes/Updates/SwitchableControllerActionsPluginUpdater.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ protected function getMigrationRecords(): array
153153
protected function getTargetListType(string $sourceListType, string $switchableControllerActions): string
154154
{
155155
foreach (self::MIGRATION_SETTINGS as $setting) {
156-
if ($setting['sourceListType'] === $sourceListType &&
157-
$setting['switchableControllerActions'] === $switchableControllerActions
156+
if ($setting['sourceListType'] === $sourceListType
157+
&& $setting['switchableControllerActions'] === $switchableControllerActions
158158
) {
159159
return $setting['targetListType'];
160160
}

Classes/ViewHelpers/CanonicalTagViewHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public function render(): string
5454
}
5555

5656
$arguments = [
57-
['tx_cartproducts_product' =>
58-
[
57+
['tx_cartproducts_product'
58+
=> [
5959
'controller' => 'Product',
6060
'product' => $product->getUid(),
6161
],

0 commit comments

Comments
 (0)