-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from JanPalen/feature/OP-371-upgrade-plugin-to…
…-sylius-1.13-support Upgrade plugin to Sylius 1.13 compatibility
- Loading branch information
Showing
57 changed files
with
397 additions
and
637 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,30 +14,25 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [8.0] | ||
node: [14.x] | ||
symfony: [^4.4, ^5.2] | ||
sylius: [~1.11.0] | ||
mysql: [5.7, 8.0] | ||
php: ["8.0", "8.1", "8.2", "8.3"] | ||
node: ["^18.0", "^20.0"] | ||
symfony: ["^5.4", "^6.4"] | ||
sylius: ["~1.12.0", "~1.13.0"] | ||
mysql: ["8.0"] | ||
|
||
exclude: | ||
- # Segmentation fault while clearing cache | ||
php: 8.0 | ||
mysql: 5.7 | ||
- | ||
sylius: ~1.9.0 | ||
php: 8.0 | ||
- | ||
sylius: ~1.11.0 | ||
php: 7.4 | ||
- sylius: "~1.13.0" | ||
php: "8.0" | ||
- symfony: "^6.4" | ||
php: "8.0" | ||
|
||
env: | ||
APP_ENV: test | ||
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}" | ||
|
||
steps: | ||
- | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- | ||
name: Setup PHP | ||
|
@@ -51,7 +46,7 @@ jobs: | |
|
||
- | ||
name: Setup Node | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "${{ matrix.node }}" | ||
|
||
|
@@ -89,7 +84,7 @@ jobs: | |
|
||
- | ||
name: Cache Composer | ||
uses: actions/cache@v2 | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }} | ||
|
@@ -116,7 +111,7 @@ jobs: | |
- | ||
name: Get Yarn cache directory | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
|
||
- | ||
name: Cache Yarn | ||
|
@@ -138,8 +133,8 @@ jobs: | |
- | ||
name: Prepare test application assets | ||
run: | | ||
(cd tests/Application && yarn encore dev) | ||
(cd tests/Application && bin/console assets:install public -vvv) | ||
(cd tests/Application && yarn build) | ||
- | ||
name: Prepare test application cache | ||
run: (cd tests/Application && bin/console cache:warmup -vvv) | ||
|
@@ -170,14 +165,14 @@ jobs: | |
|
||
- | ||
name: Upload Behat logs | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: Behat logs | ||
path: etc/build/ | ||
if-no-files-found: ignore | ||
- | ||
|
||
- | ||
name: Failed build Slack notification | ||
uses: rtCamp/action-slack-notify@v2 | ||
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
<?php | ||
|
||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
use Symplify\EasyCodingStandard\ValueObject\Option; | ||
use Symplify\EasyCodingStandard\Config\ECSConfig; | ||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$containerConfigurator->import('vendor/bitbag/coding-standard/ecs.php'); | ||
return static function (ECSConfig $config): void { | ||
putenv('ALLOW_BITBAG_OS_HEADER=1'); | ||
|
||
$parameters = $containerConfigurator->parameters(); | ||
$parameters->set(Option::PATHS, [ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
]); | ||
$config->import('vendor/bitbag/coding-standard/ecs.php'); | ||
$config->paths(['src', 'tests']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ Feature: Managing shipping gateway | |
And it has "package_length" field set to "22" | ||
And it has "cod_payment_method_code" field set to "stripe_checkout" | ||
And it has "collect_on_delivery_form" field set to "BANK_TRANSFER" | ||
And the store has a product "Chicken" priced at "$2" in "Web-US" channel | ||
And the store has a product "Chicken" priced at "$2.00" in "Web-US" channel | ||
And customer "[email protected]" has placed 5 orders on the "Web-US" channel in each buying 5 "Chicken" products | ||
And the customer set the shipping address "Mike Ross" addressed it to "350 5th Ave", "10118" "New York" in the "United States" to orders | ||
And those orders were placed with "DHL Express" shipping method | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
<?php | ||
|
||
/* | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BitBag\SyliusDhl24PlShippingExportPlugin\Api; | ||
|
||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; | ||
use Symfony\Component\HttpFoundation\RequestStack; | ||
|
||
class ShippingLabelFetcher implements ShippingLabelFetcherInterface | ||
{ | ||
/** @var WebClientInterface */ | ||
private $webClient; | ||
private WebClientInterface $webClient; | ||
|
||
/** @var SoapClientInterface */ | ||
private $soapClient; | ||
private SoapClientInterface $soapClient; | ||
|
||
/** @var string */ | ||
private $response; | ||
private object $response; | ||
|
||
private FlashBagInterface $flashBag; | ||
private RequestStack $requestStack; | ||
|
||
public function __construct( | ||
FlashBagInterface $flashBag, | ||
RequestStack $requestStack, | ||
WebClientInterface $webClient, | ||
SoapClientInterface $soapClient | ||
SoapClientInterface $soapClient, | ||
) { | ||
$this->flashBag = $flashBag; | ||
$this->requestStack = $requestStack; | ||
$this->webClient = $webClient; | ||
$this->soapClient = $soapClient; | ||
} | ||
|
@@ -38,13 +42,13 @@ public function createShipment($shippingGateway, $shipment): void | |
|
||
$this->response = $this->soapClient->createShipment($requestData, $shippingGateway->getConfigValue('wsdl')); | ||
} catch (\SoapFault $exception) { | ||
$this->flashBag->add( | ||
$this->requestStack->getSession()->getBag('flashes')->add( | ||
'error', | ||
sprintf( | ||
'DHL24 Web Service for #%s order: %s', | ||
$shipment->getOrder()->getNumber(), | ||
$exception->getMessage() | ||
) | ||
$exception->getMessage(), | ||
), | ||
); | ||
|
||
return; | ||
|
@@ -57,7 +61,7 @@ public function getLabelContent(): ?string | |
return ''; | ||
} | ||
|
||
$this->flashBag->add('success', 'bitbag.ui.shipment_data_has_been_exported'); // Add success notification | ||
$this->requestStack->getSession()->getBag('flashes')->add('success', 'bitbag.ui.shipment_data_has_been_exported'); // Add success notification | ||
|
||
return base64_decode($this->response->createShipmentResult->label->labelContent); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
<?php | ||
|
||
/* | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BitBag\SyliusDhl24PlShippingExportPlugin\Api; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by the developers from BitBag. | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* another great project. | ||
* You can find more information about us on https://bitbag.shop and write us | ||
* an email on [email protected]. | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
<?php | ||
|
||
/* | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BitBag\SyliusDhl24PlShippingExportPlugin\Api; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by the developers from BitBag. | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* another great project. | ||
* You can find more information about us on https://bitbag.shop and write us | ||
* an email on [email protected]. | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
@@ -166,7 +165,7 @@ private function resolveHouseNumber(AddressInterface $address): string | |
'Street "%s" is invalid. The street format must be something like %s, where %d is the house number.', | ||
$street, | ||
'"Opolska 45"', | ||
45 | ||
45, | ||
)); | ||
|
||
return end($streetParts); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by the developers from BitBag. | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* another great project. | ||
* You can find more information about us on https://bitbag.shop and write us | ||
* an email on [email protected]. | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by the developers from BitBag. | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* another great project. | ||
* You can find more information about us on https://bitbag.shop and write us | ||
* an email on [email protected]. | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
7 changes: 3 additions & 4 deletions
7
src/DependencyInjection/BitBagDhl24PlShippingExportExtension.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by the developers from BitBag. | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* another great project. | ||
* You can find more information about us on https://bitbag.shop and write us | ||
* an email on [email protected]. | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
Oops, something went wrong.