Skip to content

Commit 1573791

Browse files
committed
Release: v1.2.0
1 parent 5da1e2b commit 1573791

27 files changed

Lines changed: 296 additions & 76 deletions

File tree

.github/workflows/magento-ci.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ env:
66
DB_DATABASE: magento
77
DB_USER: root
88
DB_PASSWORD: root
9-
ES_VERSION: 7.10.0
10-
PHP_VERSION: 8.3
9+
OS_VERSION: 2.19.0
10+
PHP_VERSION: 8.4
11+
COMPOSER_VERSION: 2.8.9
1112

1213

1314
on: [pull_request]
@@ -23,15 +24,15 @@ jobs:
2324
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
2425
with:
2526
php-version: ${{ env.PHP_VERSION }}
26-
tools: composer
27+
tools: composer:${{ env.COMPOSER_VERSION }}, symfony-cli
2728
extensions: mbstring, gd, bcmath, soap, dom, xml, json, tokenizer, mysql, zip, xdebug
2829

2930
# Use composer cache
3031
- name: Setup - Get Composer Cache Directory
3132
id: composer-cache
3233
run: |
3334
echo "::set-output name=dir::$(composer config cache-files-dir)"
34-
- uses: actions/cache@v2
35+
- uses: actions/cache@v4
3536
with:
3637
path: ${{ steps.composer-cache.outputs.dir }}
3738
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -48,17 +49,17 @@ jobs:
4849
run: |
4950
sudo /etc/init.d/mysql start
5051
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
51-
# Set Up ElasticSearch
52+
# Set Up OpenSearch
5253
- name: Setup - Configure sysctl limits
5354
run: |
5455
sudo swapoff -a
5556
sudo sysctl -w vm.swappiness=1
5657
sudo sysctl -w fs.file-max=262144
5758
sudo sysctl -w vm.max_map_count=262144
58-
- name: Setup - ElasticSearch
59-
uses: elastic/elastic-github-actions/elasticsearch@master
59+
- name: Setup - OpenSearch
60+
uses: ankane/setup-opensearch@v1
6061
with:
61-
stack-version: ${{ env.ES_VERSION }}
62+
opensearch-version: ${{ env.OS_VERSION }}
6263

6364
# Install the latest Magento Open Source via composer
6465
- name: Setup - Install Magento Codebase
@@ -74,6 +75,12 @@ jobs:
7475
- name: Setup - Copy `install-config-mysql` file
7576
run: cp ./vendor/bloomreach/bloomreach-engagement-connector-magento/.github/config/mysql-config.php ./dev/tests/integration/etc/install-config-mysql.php
7677

78+
# Security checks
79+
- name: "[Security Check] Composer Audit"
80+
run: COMPOSER_AUDIT_ABANDONED=ignore composer audit
81+
- name: "[Security Check] Security Check"
82+
run: symfony check:security
83+
7784
# Run tests
7885
- name: Test - Magento Coding Standart
7986
if: always()

Block/Adminhtml/System/Config/ModuleVersion.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public function __construct(
4444
ScopeConfigInterface $config,
4545
TypeListInterface $cacheTypeList,
4646
ResourceInterface $moduleResource,
47-
AbstractResource $resource = null,
48-
AbstractDb $resourceCollection = null,
47+
?AbstractResource $resource = null,
48+
?AbstractDb $resourceCollection = null,
4949
array $data = []
5050
) {
5151
parent::__construct(

Console/Command/AddToExportQueue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class AddToExportQueue extends Command
3939
public function __construct(
4040
QueueProcessor $queueProcessor,
4141
State $appState,
42-
string $name = null
42+
?string $name = null
4343
) {
4444
parent::__construct($name);
4545
$this->queueProcessor = $queueProcessor;

Console/Command/StartExport.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(
4848
ExportProcessor $exportProcessor,
4949
State $appState,
5050
StartApiImportService $startApiImportService,
51-
string $name = null
51+
?string $name = null
5252
) {
5353
parent::__construct($name);
5454
$this->exportProcessor = $exportProcessor;
@@ -80,7 +80,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8080
);
8181

8282
$output->writeln('Status: ' . $result->getStatusCode());
83-
$output->writeln('Message: ' . $result->getReasonPhrase());
83+
84+
if ($result->getStatusCode() !== 200) {
85+
$output->writeln('Message: ' . $result->getErrorMessage());
86+
} else {
87+
$output->writeln('Message: Successful');
88+
}
8489
} catch (Exception $e) {
8590
$output->writeln($e->getMessage());
8691
return Cli::RETURN_FAILURE;

Exception/ExportRequestException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ExportRequestException extends LocalizedException
3030
public function __construct(
3131
Phrase $phrase,
3232
bool $isNeedUpdateRetryCounter = true,
33-
Exception $cause = null,
33+
?Exception $cause = null,
3434
$code = 0
3535
) {
3636
$this->isNeedUpdateRetryCounter = $isNeedUpdateRetryCounter;

Model/Config/Backend/ValidateCatalog.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public function __construct(
7272
EntityType $entityType,
7373
ConfigProvider $configProvider,
7474
LoggerInterface $logger,
75-
AbstractResource $resource = null,
76-
AbstractDb $resourceCollection = null,
75+
?AbstractResource $resource = null,
76+
?AbstractDb $resourceCollection = null,
7777
array $data = []
7878
) {
7979
$this->configProvider = $configProvider;

Model/DataMapping/FieldValueRenderer/OrderItem/DiscountAmount.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public function __construct(OrderItemDiscountAmount $discountAmount)
4040
*/
4141
public function render($entity, string $fieldCode)
4242
{
43-
return $this->discountAmount->getBaseDiscountAmountPerUnit($entity);
43+
return (float) $entity->getQtyOrdered() !== 0.0
44+
? $this->discountAmount->getBaseDiscountAmountPerUnit($entity)
45+
: 0.0;
4446
}
4547
}

Model/DataMapping/FieldValueRenderer/OrderItem/ItemPrice.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public function __construct(OrderItemTotalPrice $orderItemTotalPrice)
4040
*/
4141
public function render($entity, string $fieldCode)
4242
{
43+
if ((float) $entity->getQtyOrdered() === 0.0) {
44+
return 0.0;
45+
}
46+
4347
return round($this->orderItemTotalPrice->getTotalPriceBaseCurrency($entity) / $entity->getQtyOrdered(), 2);
4448
}
4549
}

Model/DataMapping/FieldValueRenderer/OrderItem/ItemPriceLocalCurrency.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public function __construct(OrderItemTotalPrice $orderItemTotalPrice)
4040
*/
4141
public function render($entity, string $fieldCode)
4242
{
43+
if ((float) $entity->getQtyOrdered() === 0.0) {
44+
return 0.0;
45+
}
46+
4347
return round($this->orderItemTotalPrice->getTotalPriceLocalCurrency($entity) / $entity->getQtyOrdered(), 2);
4448
}
4549
}

Model/DataMapping/FieldValueRenderer/Product/Boolean.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77

88
namespace Bloomreach\EngagementConnector\Model\DataMapping\FieldValueRenderer\Product;
99

10+
use Bloomreach\EngagementConnector\Model\DataMapping\FieldValueRenderer\Product\Status as StatusRenderer;
1011
use Bloomreach\EngagementConnector\Model\DataMapping\FieldValueRenderer\RenderInterface;
1112
use Magento\Catalog\Model\Product\Attribute\Source\Status;
1213
use Magento\Framework\Api\AbstractSimpleObject;
1314
use Magento\Framework\Model\AbstractModel;
1415

1516
/**
1617
* The class is responsible to render boolean field
18+
* @deprecated
19+
* @see StatusRenderer
1720
*/
1821
class Boolean implements RenderInterface
1922
{

0 commit comments

Comments
 (0)