1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the core-bundle package. |
||
5 | * |
||
6 | * (c) 2018 WEBEWEB |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace WBW\Bundle\CoreBundle; |
||
13 | |||
14 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
||
15 | use Symfony\Component\HttpKernel\Bundle\Bundle; |
||
16 | use WBW\Bundle\CoreBundle\DependencyInjection\Compiler\ColorProviderCompilerPass; |
||
17 | use WBW\Bundle\CoreBundle\DependencyInjection\Compiler\JavascriptProviderCompilerPass; |
||
18 | use WBW\Bundle\CoreBundle\DependencyInjection\Compiler\QuoteProviderCompilerPass; |
||
19 | use WBW\Bundle\CoreBundle\DependencyInjection\Compiler\StylesheetProviderCompilerPass; |
||
20 | use WBW\Bundle\CoreBundle\Provider\AssetsProviderInterface; |
||
21 | |||
22 | /** |
||
23 | * Core bundle. |
||
24 | * |
||
25 | * @author webeweb <https://github.com/webeweb> |
||
26 | * @package WBW\Bundle\CoreBundle |
||
27 | */ |
||
28 | class WBWCoreBundle extends Bundle implements AssetsProviderInterface { |
||
29 | |||
30 | /** |
||
31 | 10 | * Translation domain. |
|
32 | 10 | * |
|
33 | 10 | * @var string |
|
34 | 10 | */ |
|
35 | const TRANSLATION_DOMAIN = "WBWCoreBundle"; |
||
36 | |||
37 | /** |
||
38 | * {@inheritDoc} |
||
39 | 20 | */ |
|
40 | 20 | public function build(ContainerBuilder $container): void { |
|
41 | $container->addCompilerPass(new ColorProviderCompilerPass()); |
||
42 | $container->addCompilerPass(new QuoteProviderCompilerPass()); |
||
43 | $container->addCompilerPass(new JavascriptProviderCompilerPass()); |
||
44 | $container->addCompilerPass(new StylesheetProviderCompilerPass()); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * {@inheritDoc} |
||
49 | */ |
||
50 | public function getAssetsRelativeDirectory(): string { |
||
51 | return self::ASSETS_RELATIVE_DIRECTORY; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Get the translation domain. |
||
56 | * |
||
57 | * @return string Returns the translation domain. |
||
58 | */ |
||
59 | public static function getTranslationDomain(): string { |
||
60 | return self::TRANSLATION_DOMAIN; |
||
61 | } |
||
62 | } |
||
63 |