Skip to content

Commit

Permalink
Replace concatinated fqcn with class constant (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmatthiesen81 authored Jun 20, 2024
1 parent 1b3c4ce commit 835c76b
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php declare(strict_types=1);

namespace Shopware\Core\Checkout\Payment\Exception;
if (class_exists(__NAMESPACE__ . '\\PaymentProcessException')) {

if (class_exists(PaymentProcessException::class)) {
return;
}

use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\ShopwareHttpException;
use Symfony\Component\HttpFoundation\Response;
Expand Down
8 changes: 2 additions & 6 deletions polyfill/Shopware/Core/Checkout/Payment/PaymentException.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<?php
declare(strict_types=1);
<?php declare(strict_types=1);

namespace Shopware\Core\Checkout\Payment;


if (class_exists(__NAMESPACE__ . '\\PaymentException')) {
if (class_exists(PaymentException::class)) {
return;
}


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


class PaymentException extends \Exception
{
public static function asyncFinalizeInterrupted(string $orderTransactionId, string $errorMessage, ?\Throwable $e = null): AsyncPaymentFinalizeException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Shopware\Core\Framework\Event;

if (interface_exists(__NAMESPACE__ . '\\BusinessEventInterface')) {
if (interface_exists(BusinessEventInterface::class)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion polyfill/Shopware/Core/Framework/Event/CustomerAware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Shopware\Core\Framework\Event;

if (interface_exists(__NAMESPACE__ . '\\CustomerAware')) {
if (interface_exists(CustomerAware::class)) {
return;
}

Expand Down
5 changes: 2 additions & 3 deletions polyfill/Shopware/Core/Framework/Event/FlowEventAware.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php
declare(strict_types=1);
<?php declare(strict_types=1);

namespace Shopware\Core\Framework\Event;

if (interface_exists(__NAMESPACE__ . '\\FlowEventAware')) {
if (interface_exists(FlowEventAware::class)) {
return;
}

Expand Down
4 changes: 1 addition & 3 deletions polyfill/Shopware/Core/Framework/Event/MailAware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

namespace Shopware\Core\Framework\Event;

if (interface_exists(__NAMESPACE__ . '\\MailAware')) {
if (interface_exists(MailAware::class)) {
return;
}


use Shopware\Core\Framework\Event\EventData\MailRecipientStruct;


interface MailAware extends BusinessEventInterface
{
public const MAIL_STRUCT = 'mailStruct';
Expand Down
6 changes: 2 additions & 4 deletions polyfill/Shopware/Core/Framework/Event/OrderAware.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?php
declare(strict_types=1);
<?php declare(strict_types=1);

namespace Shopware\Core\Framework\Event;


if (interface_exists(__NAMESPACE__.'\\OrderAware')) {
if (interface_exists(OrderAware::class)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace Shopware\Core\System\Snippet\Files;


if (class_exists(__NAMESPACE__.'\\AbstractSnippetFile')) {
if (class_exists(AbstractSnippetFile::class)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace Shopware\Core\System\Snippet\Files;


if (interface_exists(__NAMESPACE__.'\\SnippetFileInterface')) {
if (interface_exists(SnippetFileInterface::class)) {
return;
}

Expand Down

0 comments on commit 835c76b

Please sign in to comment.