Merge branch '2.6' into 2.7

* 2.6:
  [TwigBundle] allowed SecurityBundle to use the latest versions of FrameworkBundle
  [HttpFoundation] Make use of isEmpty() method
  fix missing comma in YamlDumper
  [Console] Helper\Table->addRow optimization
  [Console] Helper\Table->addRow optimization
This commit is contained in:
Fabien Potencier 2015-01-13 08:22:42 +01:00
commit 0bd63ddea9
6 changed files with 8 additions and 7 deletions

View File

@ -174,8 +174,9 @@ class Table
$this->rows[] = array_values($row);
$keys = array_keys($this->rows);
$rowKey = array_pop($keys);
end($this->rows);
$rowKey = key($this->rows);
reset($this->rows);
foreach ($row as $key => $cellValue) {
if (!strstr($cellValue, "\n")) {

View File

@ -86,7 +86,7 @@ class YamlDumper extends Dumper
foreach ($attributes as $key => $value) {
$att[] = sprintf('%s: %s', $this->dumper->dump($key), $this->dumper->dump($value));
}
$att = $att ? ', '.implode(' ', $att) : '';
$att = $att ? ', '.implode(', ', $att) : '';
$tagsCode .= sprintf(" - { name: %s%s }\n", $this->dumper->dump($name), $att);
}

View File

@ -12,7 +12,7 @@ $container = new ContainerBuilder();
$container->
register('foo', 'Bar\FooClass')->
addTag('foo', array('foo' => 'foo'))->
addTag('foo', array('bar' => 'bar'))->
addTag('foo', array('bar' => 'bar', 'baz' => 'baz'))->
setFactoryClass('Bar\\FooClass')->
setFactoryMethod('getInstance')->
setArguments(array('foo', new Reference('foo.baz'), array('%foo%' => 'foo is %foo%', 'foobar' => '%foo%'), true, new Reference('service_container')))->

View File

@ -8,7 +8,7 @@
<services>
<service id="foo" class="Bar\FooClass" factory-method="getInstance" factory-class="Bar\FooClass">
<tag name="foo" foo="foo"/>
<tag name="foo" bar="bar"/>
<tag name="foo" bar="bar" baz="baz"/>
<argument>foo</argument>
<argument type="service" id="foo.baz"/>
<argument type="collection">

View File

@ -8,7 +8,7 @@ services:
class: Bar\FooClass
tags:
- { name: foo, foo: foo }
- { name: foo, bar: bar }
- { name: foo, bar: bar, baz: baz }
factory_class: Bar\FooClass
factory_method: getInstance
arguments: [foo, '@foo.baz', { '%foo%': 'foo is %foo%', foobar: '%foo%' }, true, '@service_container']

View File

@ -268,7 +268,7 @@ class Response
{
$headers = $this->headers;
if ($this->isInformational() || in_array($this->statusCode, array(204, 304))) {
if ($this->isInformational() || $this->isEmpty()) {
$this->setContent(null);
$headers->remove('Content-Type');
$headers->remove('Content-Length');