Skip to content

Commit 3f43e79

Browse files
authored
IBX-9697: Minor fixes applied (#3)
Minor fixes applied
1 parent 0afcc7b commit 3f43e79

File tree

25 files changed

+104
-75
lines changed

25 files changed

+104
-75
lines changed

src/bundle/DependencyInjection/IbexaTwigComponentsExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Ibexa\TwigComponents\Component\HtmlComponent;
1515
use Ibexa\TwigComponents\Component\LinkComponent;
1616
use Ibexa\TwigComponents\Component\ScriptComponent;
17-
use Ibexa\TwigComponents\Component\TwigComponent;
17+
use Ibexa\TwigComponents\Component\TemplateComponent;
1818
use Symfony\Component\Config\FileLocator;
1919
use Symfony\Component\Config\Resource\FileResource;
2020
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -29,7 +29,7 @@ final class IbexaTwigComponentsExtension extends Extension implements PrependExt
2929
public const COMPONENT_MAP = [
3030
'script' => ScriptComponent::class,
3131
'stylesheet' => LinkComponent::class,
32-
'template' => TwigComponent::class,
32+
'template' => TemplateComponent::class,
3333
'controller' => ControllerComponent::class,
3434
'html' => HtmlComponent::class,
3535
];

src/bundle/Resources/config/services/.gitkeep

Whitespace-only changes.

src/bundle/Resources/config/services/components.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66

77
Ibexa\TwigComponents\Component\Registry:
88

9-
Ibexa\TwigComponents\Component\TwigComponent:
9+
Ibexa\TwigComponents\Component\TemplateComponent:
1010
abstract: true
1111
lazy: true
1212

@@ -37,7 +37,7 @@ services:
3737
panelTemplate: '@IbexaTwigComponents/profiler/panel.html.twig'
3838
priority: 150
3939

40-
Ibexa\TwigComponents\Component\EventListener\TwigComponentCollectorSubscriber:
40+
Ibexa\TwigComponents\Component\EventSubscriber\TwigComponentCollectorSubscriber:
4141
tags:
4242
- { name: kernel.event_subscriber }
4343

src/bundle/Resources/views/profiler/panel.html.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@
2222
<thead>
2323
<tr>
2424
<th>Group</th>
25-
<th>Component</th>
25+
<th>Component Name</th>
26+
<th>Component Class</th>
2627
</tr>
2728
</thead>
2829
<tbody>
2930
{% for component in collector.renderedComponents %}
3031
<tr>
3132
<td>{{ component.group }}</td>
3233
<td>{{ component.name }}</td>
34+
<td>{{ component.componentClass }}</td>
3335
</tr>
3436
{% endfor %}
3537
</tbody>

src/bundle/Resources/views/themes/standard/.gitkeep

Whitespace-only changes.

src/bundle/Templating/Twig/ComponentExtension.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,15 @@
99
namespace Ibexa\Bundle\TwigComponents\Templating\Twig;
1010

1111
use Ibexa\Contracts\TwigComponents\Renderer\RendererInterface;
12-
use Ibexa\TwigComponents\Component\Registry as ComponentRegistry;
1312
use Twig\Extension\AbstractExtension;
1413
use Twig\TwigFunction;
1514

1615
final class ComponentExtension extends AbstractExtension
1716
{
18-
protected ComponentRegistry $registry;
17+
private RendererInterface $renderer;
1918

20-
protected RendererInterface $renderer;
21-
22-
public function __construct(
23-
ComponentRegistry $registry,
24-
RendererInterface $renderer
25-
) {
26-
$this->registry = $registry;
19+
public function __construct(RendererInterface $renderer)
20+
{
2721
$this->renderer = $renderer;
2822
}
2923

src/contracts/.gitkeep

Whitespace-only changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
/**
4+
* @copyright Copyright (C) Ibexa AS. All rights reserved.
5+
* @license For full copyright and license information view LICENSE file distributed with this source code.
6+
*/
7+
declare(strict_types=1);
8+
9+
namespace Ibexa\Contracts\TwigComponents;
10+
11+
interface ComponentRegistryInterface
12+
{
13+
public function addComponent(string $group, string $serviceId, ComponentInterface $component): void;
14+
15+
/**
16+
* @return \Ibexa\Contracts\TwigComponents\ComponentInterface[]
17+
*/
18+
public function getComponents(string $group): array;
19+
20+
/**
21+
* @param \Ibexa\Contracts\TwigComponents\ComponentInterface[] $components
22+
*/
23+
public function setComponents(string $group, array $components): void;
24+
}

0 commit comments

Comments
 (0)