Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symfony 2.7 deprecated notes fixed #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions DependencyInjection/MisdGuzzleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,26 @@ public function load(array $configs, ContainerBuilder $container)
$container->setParameter('misd_guzzle.log.format', $logFormat);
$container->setParameter('misd_guzzle.log.enabled', $config['log']['enabled']);

$def = $container->getDefinition('guzzle.service_builder');
if (method_exists($def, 'setFactory')) {
// to be inlined in service_builder.xml when dependency on Symfony DependencyInjection is bumped to 2.6
$def->setFactory(array('%guzzle.service_builder.class%', 'factory'));
} else {
// to be removed when dependency on Symfony DependencyInjection is bumped to 2.6
$def->setFactoryClass('%guzzle.service_builder.class%');
$def->setFactoryMethod('factory');
}

$def = $container->getDefinition('misd_guzzle.response.parser.fallback');
if (method_exists($def, 'setFactory')) {
// to be inlined in serializer.xml when dependency on Symfony DependencyInjection is bumped to 2.6
$def->setFactory(array('%misd_guzzle.response.parser.fallback.class%', 'getInstance'));
} else {
// to be removed when dependency on Symfony DependencyInjection is bumped to 2.6
$def->setFactoryClass('%misd_guzzle.response.parser.fallback.class%');
$def->setFactoryMethod('getInstance');
}

if (
version_compare(Version::VERSION, '3.6', '>=')
&& $container->hasParameter('kernel.debug')
Expand Down
3 changes: 1 addition & 2 deletions Resources/config/serializer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
<service id="misd_guzzle.request.visitor.body" class="%misd_guzzle.request.visitor.body.class%">
<argument type="service" id="jms_serializer.serializer" on-invalid="ignore"/>
</service>
<service id="misd_guzzle.response.parser.fallback" class="%misd_guzzle.response.parser.fallback.class%"
factory-class="%misd_guzzle.response.parser.fallback.class%" factory-method="getInstance"/>
<service id="misd_guzzle.response.parser.fallback" class="%misd_guzzle.response.parser.fallback.class%"/>
<service id="misd_guzzle.response.parser" class="%misd_guzzle.response.parser.class%">
<argument type="service" id="jms_serializer.serializer" on-invalid="ignore"/>
<argument type="service" id="misd_guzzle.response.parser.fallback"/>
Expand Down
3 changes: 1 addition & 2 deletions Resources/config/service_builder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
</parameters>

<services>
<service id="guzzle.service_builder" class="%guzzle.service_builder.class%"
factory-class="%guzzle.service_builder.class%" factory-method="factory">
<service id="guzzle.service_builder" class="%guzzle.service_builder.class%">
<argument type="string" id="guzzle.service_builder.configuration_file">%guzzle.service_builder.configuration_file%</argument>
</service>
</services>
Expand Down
4 changes: 0 additions & 4 deletions Tests/Functional/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ public function registerBundles()
return include $filename;
}

public function init()
{
}

public function getRootDir()
{
return __DIR__;
Expand Down