1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Lakion\SyliusCmsBundle\DependencyInjection; |
4
|
|
|
|
5
|
|
|
use Sylius\Bundle\ResourceBundle\DependencyInjection\Extension\AbstractResourceExtension; |
6
|
|
|
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle; |
7
|
|
|
use Symfony\Component\Config\FileLocator; |
8
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
9
|
|
|
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; |
10
|
|
|
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; |
11
|
|
|
use Symfony\Component\DependencyInjection\Parameter; |
12
|
|
|
|
13
|
|
|
final class LakionSyliusCmsExtension extends AbstractResourceExtension implements PrependExtensionInterface |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* {@inheritdoc} |
17
|
|
|
*/ |
18
|
|
|
public function load(array $config, ContainerBuilder $container) |
19
|
|
|
{ |
20
|
|
|
$config = $this->processConfiguration($this->getConfiguration([], $container), $config); |
|
|
|
|
21
|
|
|
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
22
|
|
|
|
23
|
|
|
$this->registerResources('lakion_sylius_cms', SyliusResourceBundle::DRIVER_DOCTRINE_PHPCR_ODM, $config['resources'], $container); |
24
|
|
|
|
25
|
|
|
$loader->load('services.xml'); |
26
|
|
|
|
27
|
|
|
$staticContentRepository = $container->getDefinition('lakion_sylius_cms.repository.static_content'); |
28
|
|
|
$staticContentRepository->addArgument(new Parameter('cmf_content.persistence.phpcr.content_basepath')); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* {@inheritdoc} |
33
|
|
|
*/ |
34
|
|
|
public function prepend(ContainerBuilder $container) |
35
|
|
|
{ |
36
|
|
|
$config = $this->processConfiguration($this->getConfiguration([], $container), $container->getExtensionConfig($this->getAlias())); |
|
|
|
|
37
|
|
|
|
38
|
|
|
$this->registerResources('lakion_sylius_cms', SyliusResourceBundle::DRIVER_DOCTRINE_PHPCR_ODM, $config['resources'], $container); |
39
|
|
|
} |
40
|
|
|
} |
41
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: