Merge branch '2.7'
* 2.7: [TwigBundle] allowed SecurityBundle to use the latest versions of FrameworkBundle [TwigBundle] fall back to security instead of tokenStorage when not available [FrameworkBundle] bumped deps for HttpKernel [TwigBundle] bumped deps for HttpKernel [HttpFoundation] Make use of isEmpty() method fix missing comma in YamlDumper [Console] Helper\Table->addRow optimization [Console] Helper\Table->addRow optimization Conflicts: src/Symfony/Bundle/FrameworkBundle/composer.json src/Symfony/Bundle/TwigBundle/composer.json
This commit is contained in:
commit
5cc6cfa71c
@ -86,11 +86,15 @@ class AppVariable
|
|||||||
*/
|
*/
|
||||||
public function getUser()
|
public function getUser()
|
||||||
{
|
{
|
||||||
if (null === $this->tokenStorage) {
|
if (null !== $this->tokenStorage) {
|
||||||
|
$tokenStorage = $this->tokenStorage;
|
||||||
|
} elseif (null !== $this->security) {
|
||||||
|
$tokenStorage = $this->security;
|
||||||
|
} else {
|
||||||
throw new \RuntimeException('The "app.user" variable is not available.');
|
throw new \RuntimeException('The "app.user" variable is not available.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$token = $this->tokenStorage->getToken()) {
|
if (!$token = $tokenStorage->getToken()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,8 +174,9 @@ class Table
|
|||||||
|
|
||||||
$this->rows[] = array_values($row);
|
$this->rows[] = array_values($row);
|
||||||
|
|
||||||
$keys = array_keys($this->rows);
|
end($this->rows);
|
||||||
$rowKey = array_pop($keys);
|
$rowKey = key($this->rows);
|
||||||
|
reset($this->rows);
|
||||||
|
|
||||||
foreach ($row as $key => $cellValue) {
|
foreach ($row as $key => $cellValue) {
|
||||||
if (!strstr($cellValue, "\n")) {
|
if (!strstr($cellValue, "\n")) {
|
||||||
|
@ -86,7 +86,7 @@ class YamlDumper extends Dumper
|
|||||||
foreach ($attributes as $key => $value) {
|
foreach ($attributes as $key => $value) {
|
||||||
$att[] = sprintf('%s: %s', $this->dumper->dump($key), $this->dumper->dump($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);
|
$tagsCode .= sprintf(" - { name: %s%s }\n", $this->dumper->dump($name), $att);
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ $container = new ContainerBuilder();
|
|||||||
$container->
|
$container->
|
||||||
register('foo', 'Bar\FooClass')->
|
register('foo', 'Bar\FooClass')->
|
||||||
addTag('foo', array('foo' => 'foo'))->
|
addTag('foo', array('foo' => 'foo'))->
|
||||||
addTag('foo', array('bar' => 'bar'))->
|
addTag('foo', array('bar' => 'bar', 'baz' => 'baz'))->
|
||||||
setFactoryClass('Bar\\FooClass')->
|
setFactoryClass('Bar\\FooClass')->
|
||||||
setFactoryMethod('getInstance')->
|
setFactoryMethod('getInstance')->
|
||||||
setArguments(array('foo', new Reference('foo.baz'), array('%foo%' => 'foo is %foo%', 'foobar' => '%foo%'), true, new Reference('service_container')))->
|
setArguments(array('foo', new Reference('foo.baz'), array('%foo%' => 'foo is %foo%', 'foobar' => '%foo%'), true, new Reference('service_container')))->
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<services>
|
<services>
|
||||||
<service id="foo" class="Bar\FooClass" factory-method="getInstance" factory-class="Bar\FooClass">
|
<service id="foo" class="Bar\FooClass" factory-method="getInstance" factory-class="Bar\FooClass">
|
||||||
<tag name="foo" foo="foo"/>
|
<tag name="foo" foo="foo"/>
|
||||||
<tag name="foo" bar="bar"/>
|
<tag name="foo" bar="bar" baz="baz"/>
|
||||||
<argument>foo</argument>
|
<argument>foo</argument>
|
||||||
<argument type="service" id="foo.baz"/>
|
<argument type="service" id="foo.baz"/>
|
||||||
<argument type="collection">
|
<argument type="collection">
|
||||||
|
@ -8,7 +8,7 @@ services:
|
|||||||
class: Bar\FooClass
|
class: Bar\FooClass
|
||||||
tags:
|
tags:
|
||||||
- { name: foo, foo: foo }
|
- { name: foo, foo: foo }
|
||||||
- { name: foo, bar: bar }
|
- { name: foo, bar: bar, baz: baz }
|
||||||
factory_class: Bar\FooClass
|
factory_class: Bar\FooClass
|
||||||
factory_method: getInstance
|
factory_method: getInstance
|
||||||
arguments: [foo, '@foo.baz', { '%foo%': 'foo is %foo%', foobar: '%foo%' }, true, '@service_container']
|
arguments: [foo, '@foo.baz', { '%foo%': 'foo is %foo%', foobar: '%foo%' }, true, '@service_container']
|
||||||
|
@ -268,7 +268,7 @@ class Response
|
|||||||
{
|
{
|
||||||
$headers = $this->headers;
|
$headers = $this->headers;
|
||||||
|
|
||||||
if ($this->isInformational() || in_array($this->statusCode, array(204, 304))) {
|
if ($this->isInformational() || $this->isEmpty()) {
|
||||||
$this->setContent(null);
|
$this->setContent(null);
|
||||||
$headers->remove('Content-Type');
|
$headers->remove('Content-Type');
|
||||||
$headers->remove('Content-Length');
|
$headers->remove('Content-Length');
|
||||||
|
Reference in New Issue
Block a user