for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\LocaleBundle\DependencyInjection;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Extension\AbstractResourceExtension;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Reference;
/**
* @author Paweł Jędrzejewski <[email protected]>
final class SyliusLocaleExtension extends AbstractResourceExtension
{
* {@inheritdoc}
public function load(array $config, ContainerBuilder $container)
$config = $this->processConfiguration($this->getConfiguration($config, $container), $config);
$this->getConfiguration($config, $container)
object|null
object<Symfony\Component...ConfigurationInterface>
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:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$this->registerResources('sylius', $config['driver'], $config['resources'], $container);
$loader->load('services.xml');
$container->setParameter('sylius_locale.locale', $config['locale']);
$container->findDefinition('sylius.repository.locale')->setLazy(true);
}
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: