From b800a9a5361810a5f53c1941790466a86573c2a8 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 3 May 2023 12:29:38 +0200 Subject: [PATCH 1/2] Add storages when constructing extension --- DependencyInjection/PayumExtension.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/DependencyInjection/PayumExtension.php b/DependencyInjection/PayumExtension.php index 4c06271..150de05 100644 --- a/DependencyInjection/PayumExtension.php +++ b/DependencyInjection/PayumExtension.php @@ -32,18 +32,23 @@ class PayumExtension extends Extension implements PrependExtensionInterface * @var StorageFactoryInterface[] */ protected array $storagesFactories = array(); - - /** - * {@inheritDoc} - */ - public function load(array $configs, ContainerBuilder $container): void + + public function __construct() { + parent::__construct(); + $this->addStorageFactory(new FilesystemStorageFactory); $this->addStorageFactory(new DoctrineStorageFactory); $this->addStorageFactory(new CustomStorageFactory); $this->addStorageFactory(new Propel1StorageFactory); $this->addStorageFactory(new Propel2StorageFactory); + } + /** + * {@inheritDoc} + */ + public function load(array $configs, ContainerBuilder $container): void + { $mainConfig = $this->getConfiguration($configs, $container); $config = $this->processConfiguration($mainConfig, $configs); From 0ecc1ac02d5800eb3c5128bf8d2d4ff09d360b07 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 3 May 2023 12:36:04 +0200 Subject: [PATCH 2/2] Remove parent constructor call --- DependencyInjection/PayumExtension.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/DependencyInjection/PayumExtension.php b/DependencyInjection/PayumExtension.php index 150de05..26edf03 100644 --- a/DependencyInjection/PayumExtension.php +++ b/DependencyInjection/PayumExtension.php @@ -32,11 +32,9 @@ class PayumExtension extends Extension implements PrependExtensionInterface * @var StorageFactoryInterface[] */ protected array $storagesFactories = array(); - + public function __construct() { - parent::__construct(); - $this->addStorageFactory(new FilesystemStorageFactory); $this->addStorageFactory(new DoctrineStorageFactory); $this->addStorageFactory(new CustomStorageFactory);