diff --git a/src/Resources/assets/sylius-logo.png b/assets/sylius-logo.png similarity index 100% rename from src/Resources/assets/sylius-logo.png rename to assets/sylius-logo.png diff --git a/src/Resources/config/app/routing/admin_invoicing.yml b/config/admin_routes.yaml similarity index 100% rename from src/Resources/config/app/routing/admin_invoicing.yml rename to config/admin_routes.yaml diff --git a/src/Resources/config/config.yml b/config/config.yaml similarity index 100% rename from src/Resources/config/config.yml rename to config/config.yaml diff --git a/src/Resources/config/doctrine/BillingData.orm.xml b/config/doctrine/BillingData.orm.xml similarity index 100% rename from src/Resources/config/doctrine/BillingData.orm.xml rename to config/doctrine/BillingData.orm.xml diff --git a/src/Resources/config/doctrine/Invoice.orm.xml b/config/doctrine/Invoice.orm.xml similarity index 100% rename from src/Resources/config/doctrine/Invoice.orm.xml rename to config/doctrine/Invoice.orm.xml diff --git a/src/Resources/config/doctrine/InvoiceSequence.orm.xml b/config/doctrine/InvoiceSequence.orm.xml similarity index 100% rename from src/Resources/config/doctrine/InvoiceSequence.orm.xml rename to config/doctrine/InvoiceSequence.orm.xml diff --git a/src/Resources/config/doctrine/InvoiceShopBillingData.orm.xml b/config/doctrine/InvoiceShopBillingData.orm.xml similarity index 100% rename from src/Resources/config/doctrine/InvoiceShopBillingData.orm.xml rename to config/doctrine/InvoiceShopBillingData.orm.xml diff --git a/src/Resources/config/doctrine/LineItem.orm.xml b/config/doctrine/LineItem.orm.xml similarity index 100% rename from src/Resources/config/doctrine/LineItem.orm.xml rename to config/doctrine/LineItem.orm.xml diff --git a/src/Resources/config/doctrine/TaxItem.orm.xml b/config/doctrine/TaxItem.orm.xml similarity index 100% rename from src/Resources/config/doctrine/TaxItem.orm.xml rename to config/doctrine/TaxItem.orm.xml diff --git a/src/Resources/config/services.xml b/config/services.xml similarity index 98% rename from src/Resources/config/services.xml rename to config/services.xml index 9fffdd4b..a5e803ef 100644 --- a/src/Resources/config/services.xml +++ b/config/services.xml @@ -6,7 +6,7 @@ - @SyliusInvoicingPlugin/Resources/assets/sylius-logo.png + @SyliusInvoicingPlugin/assets/sylius-logo.png %env(default:default_logo_file:resolve:SYLIUS_INVOICING_LOGO_FILE)% diff --git a/src/Resources/config/services/actions.xml b/config/services/actions.xml similarity index 100% rename from src/Resources/config/services/actions.xml rename to config/services/actions.xml diff --git a/src/Resources/config/services/cli.xml b/config/services/cli.xml similarity index 100% rename from src/Resources/config/services/cli.xml rename to config/services/cli.xml diff --git a/src/Resources/config/services/converters.xml b/config/services/converters.xml similarity index 100% rename from src/Resources/config/services/converters.xml rename to config/services/converters.xml diff --git a/src/Resources/config/services/fixtures.xml b/config/services/fixtures.xml similarity index 100% rename from src/Resources/config/services/fixtures.xml rename to config/services/fixtures.xml diff --git a/src/Resources/config/services/generators.xml b/config/services/generators.xml similarity index 100% rename from src/Resources/config/services/generators.xml rename to config/services/generators.xml diff --git a/src/Resources/config/services/listeners.xml b/config/services/listeners.xml similarity index 100% rename from src/Resources/config/services/listeners.xml rename to config/services/listeners.xml diff --git a/src/Resources/config/services/listeners/workflow.xml b/config/services/listeners/workflow.xml similarity index 100% rename from src/Resources/config/services/listeners/workflow.xml rename to config/services/listeners/workflow.xml diff --git a/src/Resources/config/services/ui.xml b/config/services/ui.xml similarity index 100% rename from src/Resources/config/services/ui.xml rename to config/services/ui.xml diff --git a/src/Resources/config/app/routing/shop_invoicing.yml b/config/shop_routes.yaml similarity index 100% rename from src/Resources/config/app/routing/shop_invoicing.yml rename to config/shop_routes.yaml diff --git a/src/Resources/config/validation.xml b/config/validation.xml similarity index 100% rename from src/Resources/config/validation.xml rename to config/validation.xml diff --git a/docs/legacy_installation.md b/docs/legacy_installation.md index cc4fb2f8..2736f886 100644 --- a/docs/legacy_installation.md +++ b/docs/legacy_installation.md @@ -19,18 +19,18 @@ ```yaml imports: - - { resource: "@SyliusInvoicingPlugin/Resources/config/config.yml" } + - { resource: '@SyliusInvoicingPlugin/config/config.yaml' } ``` 1. Import routing: ```yaml sylius_invoicing_plugin_admin: - resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/admin_invoicing.yml" - prefix: /admin + resource: '@SyliusInvoicingPlugin/config/admin_routes.yaml' + prefix: '/%sylius_admin.path_name%' sylius_invoicing_plugin_shop: - resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/shop_invoicing.yml" + resource: '@SyliusInvoicingPlugin/config/shop_routes.yml' prefix: /{_locale} requirements: _locale: ^[a-z]{2}(?:_[A-Z]{2})?$ diff --git a/spec/Generator/InvoicePdfFileGeneratorSpec.php b/spec/Generator/InvoicePdfFileGeneratorSpec.php index 2a9029ce..57d92508 100644 --- a/spec/Generator/InvoicePdfFileGeneratorSpec.php +++ b/spec/Generator/InvoicePdfFileGeneratorSpec.php @@ -34,7 +34,7 @@ function let( $fileLocator, $invoiceFileNameGenerator, 'invoiceTemplate.html.twig', - '@SyliusInvoicingPlugin/Resources/assets/sylius-logo.png', + '@SyliusInvoicingPlugin/assets/sylius-logo.png', ); } @@ -53,7 +53,7 @@ function it_creates_invoice_pdf_with_generated_content_and_filename_basing_on_in $invoiceFileNameGenerator->generateForPdf($invoice)->willReturn('2015_05_00004444.pdf'); $invoice->channel()->willReturn($channel); - $fileLocator->locate('@SyliusInvoicingPlugin/Resources/assets/sylius-logo.png')->willReturn('located-path/sylius-logo.png'); + $fileLocator->locate('@SyliusInvoicingPlugin/assets/sylius-logo.png')->willReturn('located-path/sylius-logo.png'); $twigToPdfGenerator ->generate('invoiceTemplate.html.twig', ['invoice' => $invoice, 'channel' => $channel, 'invoiceLogoPath' => 'located-path/sylius-logo.png']) diff --git a/src/DependencyInjection/SyliusInvoicingExtension.php b/src/DependencyInjection/SyliusInvoicingExtension.php index 3e3daa71..b52d668e 100644 --- a/src/DependencyInjection/SyliusInvoicingExtension.php +++ b/src/DependencyInjection/SyliusInvoicingExtension.php @@ -27,7 +27,7 @@ final class SyliusInvoicingExtension extends AbstractResourceExtension implement public function load(array $configs, ContainerBuilder $container): void { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); + $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../../config')); $loader->load('services.xml'); /** @var ConfigurationInterface $configuration */ @@ -55,7 +55,7 @@ protected function getMigrationsNamespace(): string protected function getMigrationsDirectory(): string { - return '@SyliusInvoicingPlugin/Migrations'; + return '@SyliusInvoicingPlugin/src/Migrations'; } protected function getNamespacesOfMigrationsExecutedBefore(): array diff --git a/src/SyliusInvoicingPlugin.php b/src/SyliusInvoicingPlugin.php index a1ead044..f07a8314 100644 --- a/src/SyliusInvoicingPlugin.php +++ b/src/SyliusInvoicingPlugin.php @@ -29,4 +29,9 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new SymfonyClockCompilerPass()); } + + public function getPath(): string + { + return \dirname(__DIR__); + } } diff --git a/src/Resources/views/Grid/Filter/channel.html.twig b/templates/Grid/Filter/channel.html.twig similarity index 100% rename from src/Resources/views/Grid/Filter/channel.html.twig rename to templates/Grid/Filter/channel.html.twig diff --git a/src/Resources/views/Invoice/Admin/_downloadButton.html.twig b/templates/Invoice/Admin/_downloadButton.html.twig similarity index 100% rename from src/Resources/views/Invoice/Admin/_downloadButton.html.twig rename to templates/Invoice/Admin/_downloadButton.html.twig diff --git a/src/Resources/views/Invoice/Admin/_resendButton.html.twig b/templates/Invoice/Admin/_resendButton.html.twig similarity index 100% rename from src/Resources/views/Invoice/Admin/_resendButton.html.twig rename to templates/Invoice/Admin/_resendButton.html.twig diff --git a/src/Resources/views/Invoice/Download/pdf.html.twig b/templates/Invoice/Download/pdf.html.twig similarity index 100% rename from src/Resources/views/Invoice/Download/pdf.html.twig rename to templates/Invoice/Download/pdf.html.twig diff --git a/src/Resources/views/Invoice/Download/pdfLayout.html.twig b/templates/Invoice/Download/pdfLayout.html.twig similarity index 100% rename from src/Resources/views/Invoice/Download/pdfLayout.html.twig rename to templates/Invoice/Download/pdfLayout.html.twig diff --git a/src/Resources/views/Invoice/Email/invoiceGenerated.html.twig b/templates/Invoice/Email/invoiceGenerated.html.twig similarity index 100% rename from src/Resources/views/Invoice/Email/invoiceGenerated.html.twig rename to templates/Invoice/Email/invoiceGenerated.html.twig diff --git a/src/Resources/views/Invoice/Grid/Field/channel.html.twig b/templates/Invoice/Grid/Field/channel.html.twig similarity index 100% rename from src/Resources/views/Invoice/Grid/Field/channel.html.twig rename to templates/Invoice/Grid/Field/channel.html.twig diff --git a/src/Resources/views/Invoice/Grid/Field/orderNumber.html.twig b/templates/Invoice/Grid/Field/orderNumber.html.twig similarity index 100% rename from src/Resources/views/Invoice/Grid/Field/orderNumber.html.twig rename to templates/Invoice/Grid/Field/orderNumber.html.twig diff --git a/src/Resources/views/Invoice/Show/_backButton.html.twig b/templates/Invoice/Show/_backButton.html.twig similarity index 100% rename from src/Resources/views/Invoice/Show/_backButton.html.twig rename to templates/Invoice/Show/_backButton.html.twig diff --git a/src/Resources/views/Invoice/Show/_billingData.html.twig b/templates/Invoice/Show/_billingData.html.twig similarity index 100% rename from src/Resources/views/Invoice/Show/_billingData.html.twig rename to templates/Invoice/Show/_billingData.html.twig diff --git a/src/Resources/views/Invoice/Show/_breadcrumb.html.twig b/templates/Invoice/Show/_breadcrumb.html.twig similarity index 100% rename from src/Resources/views/Invoice/Show/_breadcrumb.html.twig rename to templates/Invoice/Show/_breadcrumb.html.twig diff --git a/src/Resources/views/Invoice/Show/_header.html.twig b/templates/Invoice/Show/_header.html.twig similarity index 100% rename from src/Resources/views/Invoice/Show/_header.html.twig rename to templates/Invoice/Show/_header.html.twig diff --git a/src/Resources/views/Invoice/Show/_shopBillingData.html.twig b/templates/Invoice/Show/_shopBillingData.html.twig similarity index 100% rename from src/Resources/views/Invoice/Show/_shopBillingData.html.twig rename to templates/Invoice/Show/_shopBillingData.html.twig diff --git a/src/Resources/views/Invoice/show.html.twig b/templates/Invoice/show.html.twig similarity index 100% rename from src/Resources/views/Invoice/show.html.twig rename to templates/Invoice/show.html.twig diff --git a/src/Resources/views/Order/Admin/_invoices.html.twig b/templates/Order/Admin/_invoices.html.twig similarity index 100% rename from src/Resources/views/Order/Admin/_invoices.html.twig rename to templates/Order/Admin/_invoices.html.twig diff --git a/src/Resources/views/Order/Admin/fetchInvoices.html.twig b/templates/Order/Admin/fetchInvoices.html.twig similarity index 100% rename from src/Resources/views/Order/Admin/fetchInvoices.html.twig rename to templates/Order/Admin/fetchInvoices.html.twig diff --git a/src/Resources/views/Order/Shop/_downloadButton.html.twig b/templates/Order/Shop/_downloadButton.html.twig similarity index 100% rename from src/Resources/views/Order/Shop/_downloadButton.html.twig rename to templates/Order/Shop/_downloadButton.html.twig diff --git a/src/Resources/views/Order/Shop/_invoices.html.twig b/templates/Order/Shop/_invoices.html.twig similarity index 100% rename from src/Resources/views/Order/Shop/_invoices.html.twig rename to templates/Order/Shop/_invoices.html.twig diff --git a/src/Resources/views/Order/Shop/fetchInvoices.html.twig b/templates/Order/Shop/fetchInvoices.html.twig similarity index 100% rename from src/Resources/views/Order/Shop/fetchInvoices.html.twig rename to templates/Order/Shop/fetchInvoices.html.twig diff --git a/tests/Application/config/packages/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml index 389cb69f..71fdda2e 100644 --- a/tests/Application/config/packages/_sylius.yaml +++ b/tests/Application/config/packages/_sylius.yaml @@ -5,7 +5,7 @@ imports: - { resource: "@SyliusShopBundle/Resources/config/app/config.yml" } - - { resource: "@SyliusInvoicingPlugin/Resources/config/config.yml" } + - { resource: "@SyliusInvoicingPlugin/config/config.yaml" } - { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" } parameters: diff --git a/tests/Application/config/packages/sylius_invoicing.yaml b/tests/Application/config/packages/sylius_invoicing.yaml index 0075ab3b..93b2ba94 100644 --- a/tests/Application/config/packages/sylius_invoicing.yaml +++ b/tests/Application/config/packages/sylius_invoicing.yaml @@ -1,2 +1,2 @@ imports: - - { resource: "@SyliusInvoicingPlugin/Resources/config/config.yml" } + - { resource: "@SyliusInvoicingPlugin/config/config.yaml" } diff --git a/tests/Application/config/routes/sylius_invoicing_plugin.yaml b/tests/Application/config/routes/sylius_invoicing_plugin.yaml index b8fbd60f..0a4f2018 100644 --- a/tests/Application/config/routes/sylius_invoicing_plugin.yaml +++ b/tests/Application/config/routes/sylius_invoicing_plugin.yaml @@ -1,9 +1,9 @@ sylius_invoicing_plugin_admin: - resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/admin_invoicing.yml" + resource: "@SyliusInvoicingPlugin/config/admin_routes.yaml" prefix: /admin sylius_invoicing_plugin_shop: - resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/shop_invoicing.yml" + resource: "@SyliusInvoicingPlugin/config/shop_routes.yaml" prefix: /{_locale} requirements: _locale: ^[a-z]{2}(?:_[A-Z]{2})?$ diff --git a/src/Resources/translations/flashes.de.yml b/translations/flashes.de.yml similarity index 100% rename from src/Resources/translations/flashes.de.yml rename to translations/flashes.de.yml diff --git a/src/Resources/translations/flashes.en.yml b/translations/flashes.en.yml similarity index 100% rename from src/Resources/translations/flashes.en.yml rename to translations/flashes.en.yml diff --git a/src/Resources/translations/flashes.pl.yml b/translations/flashes.pl.yml similarity index 100% rename from src/Resources/translations/flashes.pl.yml rename to translations/flashes.pl.yml diff --git a/src/Resources/translations/messages.de.yml b/translations/messages.de.yml similarity index 100% rename from src/Resources/translations/messages.de.yml rename to translations/messages.de.yml diff --git a/src/Resources/translations/messages.en.yml b/translations/messages.en.yml similarity index 100% rename from src/Resources/translations/messages.en.yml rename to translations/messages.en.yml diff --git a/src/Resources/translations/messages.fr.yml b/translations/messages.fr.yml similarity index 100% rename from src/Resources/translations/messages.fr.yml rename to translations/messages.fr.yml diff --git a/src/Resources/translations/messages.pl.yml b/translations/messages.pl.yml similarity index 100% rename from src/Resources/translations/messages.pl.yml rename to translations/messages.pl.yml diff --git a/src/Resources/translations/validators.de.yml b/translations/validators.de.yml similarity index 100% rename from src/Resources/translations/validators.de.yml rename to translations/validators.de.yml diff --git a/src/Resources/translations/validators.en.yml b/translations/validators.en.yml similarity index 100% rename from src/Resources/translations/validators.en.yml rename to translations/validators.en.yml diff --git a/src/Resources/translations/validators.pl.yml b/translations/validators.pl.yml similarity index 100% rename from src/Resources/translations/validators.pl.yml rename to translations/validators.pl.yml