Skip to content

Commit

Permalink
Clean and separate configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometee committed Nov 11, 2024
1 parent 4fedfe3 commit 9a6b92a
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 21 deletions.
File renamed without changes.
2 changes: 2 additions & 0 deletions config/app/twig_hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports:
- { resource: 'twig_hooks/**/*.yaml' }
2 changes: 1 addition & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
imports:
- { resource: 'app/**/*.yaml' }
- { resource: 'app/*.yaml' }
2 changes: 1 addition & 1 deletion config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
imports:
- { resource: 'services/**/*.yaml' }
- { resource: 'services/*.yaml' }
File renamed without changes.
2 changes: 2 additions & 0 deletions config/services/listeners.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports:
- { resource: 'listeners/workflow/*.yaml' }
11 changes: 3 additions & 8 deletions config/services/state_machine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ services:

flux_se.sylius_stripe.state_machine.refund:
public: true
class: FluxSE\SyliusStripePlugin\StateMachine\PaymentStateProcessorInterface
parent: flux_se.sylius_stripe.state_machine.payment_state
arguments:
- []
Expand All @@ -27,22 +26,18 @@ services:

flux_se.sylius_stripe.state_machine.cancel:
public: true
class: FluxSE\SyliusStripePlugin\StateMachine\PaymentStateProcessorInterface
parent: flux_se.sylius_stripe.state_machine.payment_state
arguments:
-
- !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_NEW
- !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_AUTHORIZED
- 0: !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_NEW
1: !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_AUTHORIZED
- !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_CANCELLED
- !php/const Sylius\Component\Payment\Model\PaymentRequestInterface::ACTION_CANCEL


flux_se.sylius_stripe.state_machine.capture_authorized:
public: true
class: FluxSE\SyliusStripePlugin\StateMachine\PaymentStateProcessorInterface
parent: flux_se.sylius_stripe.state_machine.payment_state
arguments:
-
- !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_AUTHORIZED
- 0: !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_AUTHORIZED
- !php/const Sylius\Component\Payment\Model\PaymentInterface::STATE_COMPLETED
- !php/const Sylius\Component\Payment\Model\PaymentRequestInterface::ACTION_AUTHORIZE
2 changes: 2 additions & 0 deletions config/services/stripe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports:
- { resource: 'stripe/*.yaml' }
Empty file removed public/.gitkeep
Empty file.
19 changes: 8 additions & 11 deletions src/DependencyInjection/FluxSESyliusStripeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,19 @@ public function load(array $configs, ContainerBuilder $container): void
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../../config'));

$loader->load('services.yaml');

if ($container->hasParameter('kernel.bundles')) {
/** @var string[] $bundles */
$bundles = $container->getParameter('kernel.bundles');
if (array_key_exists('SyliusShopBundle', $bundles)) {
$loader->load('services/integrations/sylius_shop.yaml');
}
}
}

public function prepend(ContainerBuilder $container): void
{
$this->prependDoctrineMigrations($container);

$this->prependSyliusShop($container);
}

protected function getMigrationsNamespace(): string
Expand All @@ -67,13 +73,4 @@ protected function getNamespacesOfMigrationsExecutedBefore(): array
'Sylius\Bundle\CoreBundle\Migrations',
];
}

private function prependSyliusShop(ContainerBuilder $container): void
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../../config/integrations'));

if ($container->hasExtension('sylius_shop')) {
$loader->load('sylius_shop.yaml');
}
}
}

0 comments on commit 9a6b92a

Please sign in to comment.