Skip to content

Commit

Permalink
[Core] Ensure all PHP files contain defined('_PS_VERSION_')
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinMitchell committed Feb 20, 2024
1 parent 2b4359f commit 994ddcf
Show file tree
Hide file tree
Showing 30 changed files with 120 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}

class AdminConfigureBTCPayController extends ModuleAdminController
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/controllers/front/payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
use BTCPay\Server\Factory;
use PrestaShop\PrestaShop\Adapter\Configuration;

if (!defined('_PS_VERSION_')) {
exit;
}

class BTCPayPaymentModuleFrontController extends ModuleFrontController
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/controllers/front/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use BTCPay\Server\Client;
use PrestaShop\PrestaShop\Adapter\Configuration;

if (!defined('_PS_VERSION_')) {
exit;
}

class BTCPayValidationModuleFrontController extends ModuleFrontController
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/controllers/front/webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
use PrestaShop\PrestaShop\Adapter\Configuration;
use Symfony\Component\HttpFoundation\Request;

if (!defined('_PS_VERSION_')) {
exit;
}

class BTCPayWebhookModuleFrontController extends \ModuleFrontController
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

use BTCPayServer\Client\InvoiceCheckoutOptions;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Constants
{
// Version information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Throwable;

if (!\defined('_PS_VERSION_')) {
exit;
}

/**
* @ModuleActivated(moduleName="btcpay", redirectRoute="admin_module_manage")
*/
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Entity/BitcoinPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace BTCPay\Entity;

if (!\defined('_PS_VERSION_')) {
exit;
}

/**
* phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
*/
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Exception/BTCPayException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace BTCPay\Exception;

if (!\defined('_PS_VERSION_')) {
exit;
}

class BTCPayException extends \RuntimeException
{
}
4 changes: 4 additions & 0 deletions modules/btcpay/src/Form/Data/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
use PrestaShop\PrestaShop\Core\Domain\Configuration\ShopConfigurationInterface;
use Symfony\Component\Validator\Constraints as Assert;

if (!\defined('_PS_VERSION_')) {
exit;
}

class General
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Form/Data/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use PrestaShop\PrestaShop\Core\Domain\Configuration\ShopConfigurationInterface;
use Symfony\Component\Validator\Constraints as Assert;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Server
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Form/GeneralFormDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
use PrestaShop\PrestaShop\Adapter\Configuration as PrestaShopConfiguration;
use PrestaShop\PrestaShop\Core\Form\FormDataProviderInterface;

if (!\defined('_PS_VERSION_')) {
exit;
}

class GeneralFormDataProvider implements FormDataProviderInterface
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Form/ServerFormDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
use PrestaShop\PrestaShop\Adapter\Configuration as PrestaShopConfiguration;
use PrestaShop\PrestaShop\Core\Form\FormDataProviderInterface;

if (!\defined('_PS_VERSION_')) {
exit;
}

class ServerFormDataProvider implements FormDataProviderInterface
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Form/Type/GeneralType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

if (!\defined('_PS_VERSION_')) {
exit;
}

class GeneralType extends TranslatorAwareType
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Form/Type/ServerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Contracts\Translation\TranslatorInterface;

if (!\defined('_PS_VERSION_')) {
exit;
}

class ServerType extends TranslatorAwareType
{
public function __construct(TranslatorInterface $translator, array $locales)
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Github/Latest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

use Composer\Semver\Comparator;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Latest
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Github/Versioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
use Symfony\Component\Cache\Adapter\AdapterInterface;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Versioning
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Installer/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use BTCPayServer\Client\InvoiceCheckoutOptions;
use PrestaShop\PrestaShop\Adapter\Configuration;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Config
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Installer/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

use BTCPay;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Hooks
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Installer/OrderStates.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
use OrderState;
use PrestaShop\PrestaShop\Adapter\Configuration;

if (!\defined('_PS_VERSION_')) {
exit;
}

class OrderStates
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Installer/Tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

use BTCPay\Repository\BitcoinPaymentRepository;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Tables
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Installer/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
use BTCPay\Server\Client;
use PrestaShop\PrestaShop\Adapter\Configuration;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Webhook
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Invoice/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
use BTCPay\Server\Client;
use PrestaShop\PrestaShop\Adapter\Configuration;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Processor
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/LegacyBitcoinPaymentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

use BTCPay\Entity\BitcoinPayment;

if (!\defined('_PS_VERSION_')) {
exit;
}

class LegacyBitcoinPaymentRepository
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Repository/BitcoinPaymentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception;

if (!\defined('_PS_VERSION_')) {
exit;
}

class BitcoinPaymentRepository
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Server/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
use PrestaShop\PrestaShop\Adapter\Configuration;
use PrestaShop\PrestaShop\Core\Domain\Configuration\ShopConfigurationInterface;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Client extends AbstractClient
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Server/CurlAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use BTCPayServer\Http\ResponseInterface;
use STS\Backoff\Backoff;

if (!\defined('_PS_VERSION_')) {
exit;
}

class CurlAdapter extends CurlClient
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Server/Data/ValidateApiKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\Validator\Constraints as Assert;

if (!\defined('_PS_VERSION_')) {
exit;
}

class ValidateApiKey
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Server/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
use BTCPayServer\Util\PreciseNumber;
use PrestaShop\PrestaShop\Adapter\Configuration;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Factory
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Server/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
use PrestaShop\PrestaShop\Adapter\Configuration;
use Symfony\Component\HttpFoundation\Response;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Webhook extends \BTCPayServer\Client\Webhook
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/src/Server/WebhookHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
use PrestaShop\PrestaShop\Adapter\Configuration;
use Symfony\Component\HttpFoundation\Request;

if (!\defined('_PS_VERSION_')) {
exit;
}

class WebhookHandler
{
/**
Expand Down

0 comments on commit 994ddcf

Please sign in to comment.