Skip to content

Commit

Permalink
Reorganize directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
GSadee committed Nov 20, 2024
1 parent dc2ec13 commit 16fd57c
Show file tree
Hide file tree
Showing 54 changed files with 19 additions and 14 deletions.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Resources/config/services.xml → config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</imports>

<parameters>
<parameter key="default_logo_file">@SyliusInvoicingPlugin/Resources/assets/sylius-logo.png</parameter>
<parameter key="default_logo_file">@SyliusInvoicingPlugin/assets/sylius-logo.png</parameter>
<parameter key="sylius.invoicing.template.logo_file">%env(default:default_logo_file:resolve:SYLIUS_INVOICING_LOGO_FILE)%</parameter>
</parameters>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions docs/legacy_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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})?$
Expand Down
4 changes: 2 additions & 2 deletions spec/Generator/InvoicePdfFileGeneratorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function let(
$fileLocator,
$invoiceFileNameGenerator,
'invoiceTemplate.html.twig',
'@SyliusInvoicingPlugin/Resources/assets/sylius-logo.png',
'@SyliusInvoicingPlugin/assets/sylius-logo.png',
);
}

Expand All @@ -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'])
Expand Down
4 changes: 2 additions & 2 deletions src/DependencyInjection/SyliusInvoicingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -55,7 +55,7 @@ protected function getMigrationsNamespace(): string

protected function getMigrationsDirectory(): string
{
return '@SyliusInvoicingPlugin/Migrations';
return '@SyliusInvoicingPlugin/src/Migrations';
}

protected function getNamespacesOfMigrationsExecutedBefore(): array
Expand Down
5 changes: 5 additions & 0 deletions src/SyliusInvoicingPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ public function build(ContainerBuilder $container): void

$container->addCompilerPass(new SymfonyClockCompilerPass());
}

public function getPath(): string
{
return \dirname(__DIR__);
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/Application/config/packages/_sylius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/config/packages/sylius_invoicing.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
imports:
- { resource: "@SyliusInvoicingPlugin/Resources/config/config.yml" }
- { resource: "@SyliusInvoicingPlugin/config/config.yaml" }
4 changes: 2 additions & 2 deletions tests/Application/config/routes/sylius_invoicing_plugin.yaml
Original file line number Diff line number Diff line change
@@ -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})?$
2 changes: 1 addition & 1 deletion tests/DependencyInjection/SyliusInvoicingExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function it_autoconfigures_prepending_doctrine_migration_with_proper_migr
$doctrineMigrationsExtensionConfig[0]['migrations_paths']['Sylius\InvoicingPlugin\Migrations']
));
self::assertSame(
'@SyliusInvoicingPlugin/Migrations',
'@SyliusInvoicingPlugin/src/Migrations',
$doctrineMigrationsExtensionConfig[0]['migrations_paths']['Sylius\InvoicingPlugin\Migrations']
);

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 16fd57c

Please sign in to comment.