From a1345fc82e294fa6e81cfbe560ba8cf459713260 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Tue, 26 Nov 2024 12:02:18 +0200 Subject: [PATCH] [PIPRES-468] added ps version checking --- shared/Infrastructure/Exception/MollieDatabaseException.php | 4 ++++ src/Logger/LogFormatterInterface.php | 4 ++++ src/Logger/Logger.php | 4 ++++ src/Logger/LoggerInterface.php | 4 ++++ src/Utility/VersionUtility.php | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/shared/Infrastructure/Exception/MollieDatabaseException.php b/shared/Infrastructure/Exception/MollieDatabaseException.php index c1865d521..924faa422 100644 --- a/shared/Infrastructure/Exception/MollieDatabaseException.php +++ b/shared/Infrastructure/Exception/MollieDatabaseException.php @@ -15,6 +15,10 @@ use Mollie\Exception\Code\ExceptionCode; use Mollie\Exception\MollieException; +if (!defined('_PS_VERSION_')) { + exit; +} + class MollieDatabaseException extends MollieException { public static function failedToFindRecord(string $className, array $keyValues): self diff --git a/src/Logger/LogFormatterInterface.php b/src/Logger/LogFormatterInterface.php index ae2690e24..29fc45cde 100644 --- a/src/Logger/LogFormatterInterface.php +++ b/src/Logger/LogFormatterInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Logger; +if (!defined('_PS_VERSION_')) { + exit; +} + interface LogFormatterInterface { /** diff --git a/src/Logger/Logger.php b/src/Logger/Logger.php index e8c6dd505..9189faf77 100644 --- a/src/Logger/Logger.php +++ b/src/Logger/Logger.php @@ -19,6 +19,10 @@ use Mollie\Service\EntityManager\ObjectModelUnitOfWork; use Mollie\Utility\NumberIdempotencyProvider; +if (!defined('_PS_VERSION_')) { + exit; +} + class Logger implements LoggerInterface { public const FILE_NAME = 'Logger'; diff --git a/src/Logger/LoggerInterface.php b/src/Logger/LoggerInterface.php index d6230e177..747f0c3ff 100644 --- a/src/Logger/LoggerInterface.php +++ b/src/Logger/LoggerInterface.php @@ -12,6 +12,10 @@ namespace Mollie\Logger; +if (!defined('_PS_VERSION_')) { + exit; +} + interface LoggerInterface extends \Psr\Log\LoggerInterface { } diff --git a/src/Utility/VersionUtility.php b/src/Utility/VersionUtility.php index c3c27468f..de8d36076 100644 --- a/src/Utility/VersionUtility.php +++ b/src/Utility/VersionUtility.php @@ -12,6 +12,10 @@ namespace Mollie\Utility; +if (!defined('_PS_VERSION_')) { + exit; +} + class VersionUtility { public static function isPsVersionLessThan($version): int