Skip to content

Commit 7e276d2

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: Fixing missing abstract attribute in XmlDumper [Form] Remove DateTimeToStringTransformer $parseUsingPipe option Fix file perms Fixed filename in help text for update-data.php
2 parents e5168d1 + 155b770 commit 7e276d2

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

Dumper/XmlDumper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ private function addService($definition, $id, \DOMElement $parent)
200200
$service->appendChild($autowiringType);
201201
}
202202

203+
if ($definition->isAbstract()) {
204+
$service->setAttribute('abstract', 'true');
205+
}
206+
203207
if ($callable = $definition->getConfigurator()) {
204208
$configurator = $this->document->createElement('configurator');
205209

Tests/Dumper/XmlDumperTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,12 @@ public function testDumpAutowireData()
171171

172172
$this->assertEquals(file_get_contents(self::$fixturesPath.'/xml/services24.xml'), $dumper->dump());
173173
}
174+
175+
public function testDumpAbstractServices()
176+
{
177+
$container = include self::$fixturesPath.'/containers/container_abstract.php';
178+
$dumper = new XmlDumper($container);
179+
180+
$this->assertEquals(file_get_contents(self::$fixturesPath.'/xml/services_abstract.xml'), $dumper->dump());
181+
}
174182
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
use Symfony\Component\DependencyInjection\ContainerBuilder;
4+
5+
$container = new ContainerBuilder();
6+
7+
$container
8+
->register('foo', 'Foo')
9+
->setAbstract(true)
10+
;
11+
12+
return $container;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
3+
<services>
4+
<service id="foo" class="Foo" abstract="true"/>
5+
</services>
6+
</container>

0 commit comments

Comments
 (0)