Skip to content

Commit 751228c

Browse files
Merge pull request #121 from Paazl/release/1.19.0
Release/1.19.0
2 parents e9f0b2e + 2d358bd commit 751228c

File tree

24 files changed

+150
-91
lines changed

24 files changed

+150
-91
lines changed

.github/workflows/linting.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@ jobs:
55
php-74:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: StephaneBour/[email protected]
9-
with:
10-
dir: './'
8+
- uses: prestashop/github-action-php-lint/[email protected]
119

12-
php-80:
10+
php-81:
1311
runs-on: ubuntu-latest
1412
steps:
15-
- uses: StephaneBour/[email protected]
16-
with:
17-
dir: './'
13+
- uses: prestashop/github-action-php-lint/[email protected]
1814

19-
php-81:
15+
php-82:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: prestashop/github-action-php-lint/[email protected]
19+
20+
php-83:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: prestashop/github-action-php-lint/[email protected]
24+
25+
php-84:
2026
runs-on: ubuntu-latest
2127
steps:
22-
- uses: StephaneBour/[email protected]
23-
with:
24-
dir: './'
28+
- uses: prestashop/github-action-php-lint/[email protected]

.github/workflows/setup-di-compile.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
MAGENTO_VERSION: 2.4.4
1313
- PHP_VERSION: php82-fpm
1414
MAGENTO_VERSION: 2.4.6
15+
- PHP_VERSION: php83-fpm
16+
MAGENTO_VERSION: 2.4.7
17+
- PHP_VERSION: php84-fpm
18+
MAGENTO_VERSION: 2.4.8
1519
runs-on: ubuntu-latest
1620
steps:
1721
- uses: actions/checkout@v1
@@ -29,4 +33,4 @@ jobs:
2933
run: docker exec magento-project-community-edition composer require paazl/magento2-checkout-widget:@dev --no-plugins
3034

3135
- name: Run setup:di:compile
32-
run: docker exec magento-project-community-edition ./retry "php bin/magento setup:di:compile"
36+
run: docker exec magento-project-community-edition ./retry "php bin/magento setup:di:compile"

.github/workflows/templates/docker-compose.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

Api/Data/Quote/QuoteReferenceInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ public function getTokenExpiresAt();
7979
*
8080
* @return bool
8181
*/
82-
public function isTokenExpired(\DateTime $now = null);
82+
public function isTokenExpired(?\DateTime $now = null);
8383
}

GraphQL/Resolver/ConfigurationResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(
5151
$this->quoteIdMaskResource = $quoteIdMaskResource;
5252
}
5353

54-
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
54+
public function resolve(Field $field, $context, ResolveInfo $info, ?array $value = null, ?array $args = null)
5555
{
5656
if (!isset($args['cart_id']) || empty($args['cart_id'])) {
5757
throw new GraphQlInputException(__('"cart_id" is required'));

Logger/PaazlHandler.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
11
<?php
22
/**
3-
* Copyright © 2019 Paazl. All rights reserved.
3+
* Copyright © Paazl. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Paazl\CheckoutWidget\Logger;
89

910
use Monolog\Logger;
1011
use Magento\Framework\Logger\Handler\Base;
1112

12-
/**
13-
* Class PaazlHandler
14-
*
15-
* @package Paazl\CheckoutWidget\Logger
16-
*/
1713
class PaazlHandler extends Base
1814
{
19-
20-
/**
21-
* @var int
22-
*/
2315
protected $loggerType = Logger::DEBUG;
24-
/**
25-
* @var string
26-
*/
2716
protected $fileName = '/var/log/paazl.log';
2817
}

Logger/PaazlLogger.php

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,27 @@
88
namespace Paazl\CheckoutWidget\Logger;
99

1010
use Magento\Framework\Serialize\Serializer\Json;
11-
use Monolog\Logger;
11+
use Monolog\Logger as MonologLogger;
1212

13-
/**
14-
* DebugLogger logger class
15-
*/
16-
class PaazlLogger extends Logger
13+
class PaazlLogger
1714
{
15+
private MonologLogger $logger;
16+
private Json $json;
1817

19-
/**
20-
* @var Json
21-
*/
22-
private $json;
23-
24-
/**
25-
* DebugLogger constructor.
26-
*
27-
* @param Json $json
28-
* @param string $name
29-
* @param array $handlers
30-
* @param array $processors
31-
*/
3218
public function __construct(
33-
Json $json,
34-
string $name,
35-
array $handlers = [],
36-
array $processors = []
19+
MonologLogger $logger,
20+
Json $json
3721
) {
22+
$this->logger = $logger;
3823
$this->json = $json;
39-
parent::__construct($name, $handlers, $processors);
4024
}
4125

42-
/**
43-
* @param string $type
44-
* @param mixed $data
45-
*/
46-
public function add($type, $data)
26+
public function add(string $type, $data): void
4727
{
4828
if (is_array($data) || is_object($data)) {
49-
$this->addRecord(static::INFO, $type . ': ' . $this->json->serialize($data));
29+
$this->logger->info( $type . ': ' . $this->json->serialize($data));
5030
} else {
51-
$this->addRecord(static::INFO, $type . ': ' . $data);
31+
$this->logger->info( $type . ': ' . $data);
5232
}
5333
}
5434
}

Model/Admin/Order/Create/PaazlConfigProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public function getConfig()
7878
$config['googleMapKey'] = $this->config->getGoogleMapKey($storeId);
7979
$config['widgetConfig'] = $this->widgetConfigProvider->getConfig();
8080
$config['mode'] = $this->config->isProductionApiMode($storeId) ? 'live' : 'test';
81+
$config['version'] = $this->config->getApiVersion($storeId);
8182

8283
if (empty($config['widgetConfig']['token'])) {
8384
// We were unable to obtain a token - enabling other methods if they're available

Model/Api/ApiException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ApiException extends \Exception
2020
public function __construct(
2121
$message = "",
2222
$code = 0,
23-
Throwable $previous = null,
23+
?Throwable $previous = null,
2424
$response = false
2525
) {
2626
if ($response) {

Model/Api/UrlProviderFactory.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public function __construct(
4646
*/
4747
public function create($storeId = null): UrlProvider
4848
{
49-
return $this->objectManager->create(UrlProvider::class, ['mode' => $this->config->getApiMode($storeId)]);
49+
return $this->objectManager->create(
50+
UrlProvider::class,
51+
[
52+
'mode' => $this->config->getApiMode($storeId),
53+
'version' => $this->config->getApiVersion($storeId)
54+
]
55+
);
5056
}
5157
}

0 commit comments

Comments
 (0)