Skip to content

Commit

Permalink
NTR: updates for 6.6 (#721)
Browse files Browse the repository at this point in the history
* NTR: set routing to xml

* NTR: update routes

* NTR: delete 6.5 specific controller

* NTR: cleanup

* NTR: fallback einbauen

* NTR: fix routing for 6.5

* NTR: revert fixtures

* NTR: fix routes scopes

* NTR: fix routescope

* NTR: phpstan fix

* NTR: fix some tests for 6.6

* NTR: fix twig and exceptions

* NTR: fix stan

* NTR: fix smart contact form

* NTR: fix phpstan errors

* NTR: fix smart contact form

* NTR: revert cart service

* NTR: Csfix

* NTR: add 6.6 to pipline

* NTR: fix cart service

* NTR: csfixer

* NTR: fix add product

* NTR: fix controller

* NTR: admin updates

* NTR: Update linter

* NTR: fix refund manager

* NTR: delete route annotations

* NTR: add 6.6 to pipeline

* NTR: fix subscription

* NTR: csfix

* NTR: fix mgration for sw 6.4

* NTR: update new sw version in pipeline checks

* NTR: test apple pay buttons

* NTR: bumb sw version

* NTR: update php version

* NTR: fix preview

* NTR: eslint fix

* NTR: eslint

* NTR: eslint

---------

Co-authored-by: Vitalij Mik <[email protected]>
  • Loading branch information
BlackScorp and Vitalij Mik authored Apr 16, 2024
1 parent 4b1986b commit 675d137
Show file tree
Hide file tree
Showing 178 changed files with 1,810 additions and 1,784 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci_pipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ jobs:
fail-fast: false
matrix:
include:
- shopware: '6.6.1.0'
php: '8.2'
- shopware: '6.5.8.8'
php: '8.2'
- shopware: '6.5.6.1'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nightly_pipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ jobs:
fail-fast: false
matrix:
include:
- shopware: '6.6.1.0'
php: '8.2'
- shopware: '6.5.8.8'
php: '8.2'
- shopware: '6.5.6.1'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr_pipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ jobs:
fail-fast: false
matrix:
include:
- shopware: '6.6.1.0'
php: '8.2'
- shopware: '6.5.8.8'
php: '8.2'
- shopware: '6.5.5.2'
Expand Down
27 changes: 14 additions & 13 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php declare(strict_types=1);

namespace Shopware\Core\Checkout\Payment\Exception;
if (class_exists(__NAMESPACE__ . '/PaymentProcessException')) {
return;
}
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\ShopwareHttpException;
use Symfony\Component\HttpFoundation\Response;

#[Package('checkout')]
abstract class PaymentProcessException extends ShopwareHttpException
{
private string $orderTransactionId;

public function __construct(
string $orderTransactionId,
string $message,
array $parameters = [],
?\Throwable $e = null
) {
$this->orderTransactionId = $orderTransactionId;

parent::__construct($message, $parameters, $e);
}

public function getStatusCode(): int
{
return Response::HTTP_BAD_REQUEST;
}

public function getOrderTransactionId(): string
{
return $this->orderTransactionId;
}
}
25 changes: 25 additions & 0 deletions polyfill/Shopware/Core/Checkout/Payment/PaymentException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);

namespace Shopware\Core\Checkout\Payment;


if (class_exists(__NAMESPACE__ . '/PaymentException')) {
return;
}

use Shopware\Core\Checkout\Payment\Exception\AsyncPaymentFinalizeException;
use Shopware\Core\Checkout\Payment\Exception\CustomerCanceledAsyncPaymentException;

class PaymentException
{
public static function asyncFinalizeInterrupted(string $orderTransactionId, string $errorMessage, ?\Throwable $e = null): self
{
return new AsyncPaymentFinalizeException($orderTransactionId, $errorMessage, $e);
}

public static function customerCanceled(string $orderTransactionId, string $additionalInformation, ?\Throwable $e = null): self
{
return new CustomerCanceledAsyncPaymentException($orderTransactionId, $additionalInformation, $e);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php declare(strict_types=1);

namespace Shopware\Core\System\Snippet\Files;


if (class_exists(__NAMESPACE__.'/AbstractSnippetFile')) {
return;
}

use Shopware\Core\Framework\Log\Package;

#[Package('system-settings')]
abstract class AbstractSnippetFile implements SnippetFileInterface
{
/**
* Returns the displayed name.
*
* Example:
* storefront.en-GB
*/
abstract public function getName(): string;

/**
* Returns the path to the json language file.
*
* Example:
* /appPath/subDirectory/storefront.en-GB.json
*/
abstract public function getPath(): string;

/**
* Returns the associated language ISO.
*
* Example:
* en-GB
* de-DE
*/
abstract public function getIso(): string;

/**
* Return the snippet author, which will be used when editing a file snippet in a snippet set
*
* Example:
* shopware
* pluginName
*/
abstract public function getAuthor(): string;

/**
* Returns a boolean which determines if its a base language file
*/
abstract public function isBase(): bool;

/**
* Returns a technical name of the bundle or app that the file is belonged to
*/
abstract public function getTechnicalName(): string;
}
45 changes: 0 additions & 45 deletions src/Compatibility/DependencyLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ public function loadServices(): void

$loader = new XmlFileLoader($containerBuilder, new FileLocator(__DIR__ . '/../Resources/config'));

# load all our base services that
# we need all the time
$loader->load('services.xml');

# now load our base compatibility services
# that already wrap our functions for different shopware versions
$loader->load('compatibility/base.xml');


# load Flow Builder
$loader->load('compatibility/flowbuilder/all_versions.xml');
Expand All @@ -56,25 +48,6 @@ public function loadServices(): void
$loader->load('compatibility/flowbuilder/6.4.6.0.xml');
}

# load other data
if ($versionCompare->gte('6.4')) {
$loader->load('compatibility/services_6.4.xml');
} elseif ($versionCompare->gte('6.3.5.0')) {
$loader->load('compatibility/services_6.3.5.0.xml');
}

if ($versionCompare->gte('6.5')) {
$loader->load('compatibility/snippets_6.5.xml');
} else {
$loader->load('compatibility/snippets.xml');
}

if ($versionCompare->gte('6.5')) {
$loader->load('compatibility/controller_6.5.xml');
} else {
$loader->load('compatibility/controller.xml');
}


$composerDevReqsInstalled = file_exists(__DIR__ . '/../../vendor/bin/phpunit');

Expand Down Expand Up @@ -126,22 +99,4 @@ public function prepareStorefrontBuild(): void
# copy($file, $target);
}
}

/**
* @param string $pluginPath
* @return string
*/
public function getRoutesPath(string $pluginPath): string
{
/** @var string $version */
$version = $this->container->getParameter('kernel.shopware_version');

$versionCompare = new VersionCompare($version);

if ($versionCompare->gte('6.5')) {
return $pluginPath . '/Resources/config/compatibility/routes/sw65';
}

return $pluginPath . '/Resources/config/compatibility/routes/sw6';
}
}

This file was deleted.

24 changes: 24 additions & 0 deletions src/Components/Subscription/DAL/Currency/CurrencyExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);

namespace Kiener\MolliePayments\Components\Subscription\DAL\Currency;

use Kiener\MolliePayments\Components\Subscription\DAL\Subscription\SubscriptionDefinition;
use Shopware\Core\Framework\DataAbstractionLayer\EntityExtension;
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\CascadeDelete;
use Shopware\Core\Framework\DataAbstractionLayer\Field\OneToManyAssociationField;
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection;
use Shopware\Core\System\Currency\CurrencyDefinition;

class CurrencyExtension extends EntityExtension
{
public function getDefinitionClass(): string
{
return CurrencyDefinition::class;
}

public function extendFields(FieldCollection $collection): void
{
$collection->add((new OneToManyAssociationField('subscriptions', SubscriptionDefinition::class, 'currency_id'))->addFlags(new CascadeDelete()));
}
}
Loading

0 comments on commit 675d137

Please sign in to comment.