Skip to content

Commit 1f8f6e5

Browse files
committed
feat: house keeping and improving symfony bundle
1 parent 8db66e5 commit 1f8f6e5

1 file changed

Lines changed: 10 additions & 17 deletions

File tree

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Html\TwigComponentBundle\DependencyInjection;
46

5-
use Symfony\Component\Config\FileLocator;
6-
use Symfony\Component\DependencyInjection\ContainerBuilder;
7-
use Symfony\Component\DependencyInjection\Extension\Extension;
8-
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
7+
use Symfony\Component\DependencyInjection\{
8+
ContainerBuilder,
9+
Extension\Extension,
10+
};
911

10-
/**
11-
* HtmlTwigComponentExtension - Auto-registers Twig Components
12-
*
13-
* Automatically discovers and registers all Twig Component classes from the bundle,
14-
* enabling auto-configuration of components with #[AsTwigComponent] attribute.
15-
*
16-
* @author vardumper <info@erikpoehler.com>
17-
* @package Html\TwigComponentBundle\DependencyInjection
18-
*/
1912
class HtmlTwigComponentExtension extends Extension
2013
{
2114
public function load(array $configs, ContainerBuilder $container): void
@@ -29,12 +22,12 @@ public function getAlias(): string
2922

3023
public function prepend(ContainerBuilder $container): void
3124
{
32-
$bundlePath = dirname(__DIR__); // Gets the bundle's root directory
33-
25+
$bundlePath = \dirname(__DIR__);
26+
3427
$container->prependExtensionConfig('twig', [
3528
'paths' => [
36-
$bundlePath . '/Resources' => 'HtmlTwigComponent'
37-
]
29+
$bundlePath . '/Resources' => 'HtmlTwigComponent',
30+
],
3831
]);
3932
}
4033
}

0 commit comments

Comments
 (0)