Skip to content

Commit

Permalink
[Maintenance] Reorganize config files and update their extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafikooo committed Dec 9, 2024
1 parent 7db8ea3 commit ed433a0
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 18 deletions.
18 changes: 14 additions & 4 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
bin/console doctrine:migrations:migrate --no-interaction
```

1. The directories structure has been updated to the current Symfony recommendations:
1. The structures of the directories have been updated to follow the current Symfony recommendations:
- `@SyliusRefundPlugin/Resources/assets` -> `@SyliusRefundPlugin/assets`
- `@SyliusRefundPlugin/Resources/config` -> `@SyliusRefundPlugin/config`
- `@SyliusRefundPlugin/Resources/translations` -> `@SyliusRefundPlugin/translations`
- `@SyliusRefundPlugin/Resources/views` -> `@SyliusRefundPlugin/templates`
Expand All @@ -38,9 +39,18 @@

And the routes configuration paths:
```diff
sylius_refund:
- resource: "@SyliusRefundPlugin/Resources/config/routing.yml"
+ resource: "@SyliusRefundPlugin/config/routing.yml"
- sylius_refund:
- resource: "@SyliusRefundPlugin/Resources/config/routing.yml"
+ sylius_refund_admin:
+ resource: "@SyliusRefundPlugin/config/admin_routes.yaml"
+ prefix: '/%sylius_admin.path_name%'
+
+ sylius_refund_shop:
+ resource: "@SyliusRefundPlugin/config/shop_routes.yaml"
+ prefix: /{_locale}
+ requirements:
+ _locale: ^[a-z]{2}(?:_[A-Z]{2})?$

```

Adjust the paths to assets and templates if you are using them.
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions config/app/config.yml → config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
imports:
- { resource: "@SyliusRefundPlugin/config/app/twig_hooks/**/*.yaml" }
- { resource: "@SyliusRefundPlugin/config/app/integrations.php" }
- { resource: "@SyliusRefundPlugin/config/twig_hooks/**/*.yaml" }
- { resource: "@SyliusRefundPlugin/config/integrations.php" }

parameters:
sylius_refund.credit_memo_save_path: "%kernel.project_dir%/private/credit_memos/"
Expand Down
2 changes: 1 addition & 1 deletion config/app/integrations.php → config/integrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

return static function (ContainerConfigurator $configurator, ContainerBuilder $container): void {
if (class_exists(winzouStateMachineBundle::class)) {
$configurator->import('../integrations/winzou_state_machine.yaml');
$configurator->import('integrations/winzou_state_machine.yaml');
}
};
File renamed without changes.
File renamed without changes.
16 changes: 12 additions & 4 deletions docs/legacy_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,23 @@

```yaml
imports:
- { resource: "@SyliusRefundPlugin/config/app/config.yml" }
- { resource: "@SyliusRefundPlugin/config/config.yaml" }
```
1. Import routing:

````yaml
sylius_refund:
resource: "@SyliusRefundPlugin/config/routing.yml"
sylius_refund_admin:
resource: "@SyliusRefundPlugin/config/admin_routes.yaml"
prefix: '/%sylius_admin.path_name%'

sylius_refund_shop:
resource: "@SyliusRefundPlugin/config/shop_routes.yaml"
prefix: /{_locale}
requirements:
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$

````

1. Apply migrations to your database:

```bash
Expand Down
1 change: 0 additions & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
$containerConfigurator->skip([
VisibilityRequiredFixer::class => ['*Spec.php'],
InlineDocCommentDeclarationSniff::class . '.MissingVariable',
'src/Resources/config/**',
'**/var/*',
]);

Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ parameters:
- 'src/DependencyInjection/Configuration.php'

# Test dependencies
- 'tests/Application/app/**.php'
- 'tests/Application/src/**.php'

ignoreErrors:
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/config/packages/sylius_refund.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
imports:
- { resource: "@SyliusRefundPlugin/config/app/config.yml" }
- { resource: "@SyliusRefundPlugin/config/config.yaml" }
2 changes: 0 additions & 2 deletions tests/Application/config/routes.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sylius_refund_admin:
resource: "@SyliusRefundPlugin/config/admin_routing.yml"
resource: "@SyliusRefundPlugin/config/admin_routes.yaml"
prefix: '/%sylius_admin.path_name%'

sylius_refund_shop:
resource: "@SyliusRefundPlugin/config/shop_routing.yml"
resource: "@SyliusRefundPlugin/config/shop_routes.yaml"
prefix: /{_locale}
requirements:
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$

0 comments on commit ed433a0

Please sign in to comment.