Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Twig hooks configuration #66

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true],
Sylius\TwigHooks\TwigHooksBundle::class => ['all' => true],
Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true],
Sylius\TwigExtra\Symfony\SyliusTwigExtraBundle::class => ['all' => true],
Sylius\AdminUi\Symfony\SyliusAdminUiBundle::class => ['all' => true],
Sylius\UiTranslations\Symfony\SyliusUiTranslationsBundle::class => ['all' => true],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
twig_hooks:
sylius_twig_hooks:
hooks:
'app.base':
content:
Expand Down
4 changes: 2 additions & 2 deletions docs/twig-hooks/advanced/overriding-hookables.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Let's consider the following hooks configuration:

{% code title="config/packages/twig_hooks.yaml" lineNumbers="true" %}
```yaml
twig_hooks:
sylius_twig_hooks:
hooks:
'app.common.create':
header:
Expand Down Expand Up @@ -85,7 +85,7 @@ As there is no configuration for the `app.course.create` and `app.course_categor

{% code title="config/packages/twig_hooks.yaml" lineNumbers="true" %}
```
twig_hooks:
sylius_twig_hooks:
hooks:
'app.common.create':
header:
Expand Down
4 changes: 2 additions & 2 deletions docs/twig-hooks/autoprefixing-feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
`Autoprefixing` is turned off by default. If you want to use this feature you need to set the `enable_autoprefixing` setting to `true` in your `config/packages/twig_hooks.yaml` file:

```
twig_hooks:
sylius_twig_hooks:
# ...
enable_autoprefixing: true
# ...
Expand Down Expand Up @@ -92,7 +92,7 @@ The configuration for the hooks and hookables above is:

{% code title="config/packages/twig_hooks.yaml" lineNumbers="true" %}
```yaml
twig_hooks:
sylius_twig_hooks:
hooks:
'app.index':
content:
Expand Down
6 changes: 3 additions & 3 deletions docs/twig-hooks/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Now, we can define our first hookable with the following configuration:

{% code title="config/packages/twig_hooks.yaml" lineNumbers="true" %}
```yaml
twig_hooks:
sylius_twig_hooks:
hooks:
'my_first_hook':
some_block:
Expand All @@ -96,7 +96,7 @@ Depending on the hookable template, we can pass different configuration options
{% tab title="Hookable Template" %}
{% code lineNumbers="true" %}
```yaml
twig_hooks:
sylius_twig_hooks:
hooks:
'my_first_hook':
some_block:
Expand All @@ -112,7 +112,7 @@ twig_hooks:
{% tab title="Hookable Component" %}
{% code title="" %}
```yaml
twig_hooks:
sylius_twig_hooks:
hooks:
'my_first_hook':
some_block:
Expand Down
2 changes: 1 addition & 1 deletion docs/twig-hooks/making-your-hookables-configurable.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Configuration can be defined only while defining a hookable, and is accessibly w

{% code title="twig_hooks.yaml" lineNumbers="true" %}
```
twig_hooks:
sylius_twig_hooks:
hooks:
'index.form':
name:
Expand Down
1 change: 1 addition & 0 deletions src/AdminUi/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"autoload-dev": {
"psr-4": {
"Sylius\\TwigHooks\\": "../TwigHooks/src/",
"TestApplication\\Sylius\\AdminUi\\": "tests/Functional/.application/src/",
"Tests\\Sylius\\AdminUi\\": "tests/"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true],
Sylius\TwigHooks\TwigHooksBundle::class => ['all' => true],
Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true],
Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
Sylius\AdminUi\Symfony\SyliusAdminUiBundle::class => ['all' => true],
];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
twig_hooks:
sylius_twig_hooks:
enable_autoprefixing: true
hook_name_section_separator: '#'
hooks:
Expand Down
1 change: 1 addition & 0 deletions src/BootstrapAdminUi/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
},
"autoload-dev": {
"psr-4": {
"Sylius\\TwigHooks\\": "../TwigHooks/src/",
"TestApplication\\Sylius\\BootstrapAdminUi\\": "tests/Functional/.application/src/",
"Tests\\Sylius\\BootstrapAdminUi\\": "tests/"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container): void {
$container->extension('twig_hooks', [
$container->extension('sylius_twig_hooks', [
'hooks' => [
'sylius_admin.common.create' => [
'sidebar' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container): void {
$container->extension('twig_hooks', [
$container->extension('sylius_twig_hooks', [
'hooks' => [
'sylius_admin.common.index' => [
'sidebar' => [
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapAdminUi/config/app/twig_hooks/common/show.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container): void {
$container->extension('twig_hooks', [
$container->extension('sylius_twig_hooks', [
'hooks' => [
'sylius_admin.common.show' => [
'sidebar' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container): void {
$container->extension('twig_hooks', [
$container->extension('sylius_twig_hooks', [
'hooks' => [
'sylius_admin.common.update' => [
'sidebar' => [
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapAdminUi/config/app/twig_hooks/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container): void {
$container->extension('twig_hooks', [
$container->extension('sylius_twig_hooks', [
'hooks' => [
'sylius_admin.base#stylesheets' => [
'styles' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container): void {
$container->extension('twig_hooks', [
$container->extension('sylius_twig_hooks', [
'hooks' => [
'sylius_admin.common.component.sidebar' => [
'logo' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function prependExtension(ContainerConfigurator $container, ContainerBuil
return;
}

$container->extension('twig_hooks', [
$container->extension('sylius_twig_hooks', [
'enable_autoprefixing' => true,
'hook_name_section_separator' => '#',
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true],
Sylius\TwigHooks\TwigHooksBundle::class => ['all' => true],
Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true],
Sylius\BootstrapAdminUi\Symfony\SyliusBootstrapAdminUiBundle::class => ['all' => true],
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
Expand Down
2 changes: 1 addition & 1 deletion src/TwigHooks/src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('twig_hooks');
$treeBuilder = new TreeBuilder('sylius_twig_hooks');

$rootNode = $treeBuilder->getRootNode();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;

final class TwigHooksExtension extends Extension
final class SyliusTwigHooksExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use Symfony\Component\HttpKernel\Bundle\Bundle;

final class TwigHooksBundle extends Bundle
final class SyliusTwigHooksBundle extends Bundle
{
public function getPath(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true],
Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true],
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
Sylius\TwigHooks\TwigHooksBundle::class => ['all' => true],
Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true],
];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
twig_hooks:
sylius_twig_hooks:
enable_autoprefixing: true
hook_name_section_separator: '#'
hooks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
namespace Tests\Sylius\TwigHooks\Integration\DependencyInjection;

use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
use Sylius\TwigHooks\DependencyInjection\TwigHooksExtension;
use Sylius\TwigHooks\DependencyInjection\SyliusTwigHooksExtension;
use Sylius\TwigHooks\Hookable\DisabledHookable;
use Sylius\TwigHooks\Hookable\HookableComponent;
use Sylius\TwigHooks\Hookable\HookableTemplate;

final class TwigHooksExtensionTest extends AbstractExtensionTestCase
final class SyliusTwigHooksExtensionTest extends AbstractExtensionTestCase
{
public function testItSetsEnableAutoprefixingParameter(): void
{
Expand Down Expand Up @@ -90,7 +90,7 @@ public function testItRegistersHookablesAsServices(): void
protected function getContainerExtensions(): array
{
return [
new TwigHooksExtension(),
new SyliusTwigHooksExtension(),
];
}
}
Loading