8000 Merge branch '4.2' into 4.3 · symfony/symfony@2dedf38 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2dedf38

Browse files
Merge branch '4.2' into 4.3
* 4.2: [Lock] fix missing inherit docs in RedisStore fix accessing session bags Add missing rendering of form help block.
2 parents 4e915bd + dd68ae3 commit 2dedf38

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
<div class="form-group{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}">
115115
{{- form_label(form) }} {# -#}
116116
{{ form_widget(form, widget_attr) }} {# -#}
117+
{{- form_help(form) -}}
117118
{{ form_errors(form) }} {# -#}
118119
</div> {# -#}
119120
{%- endblock form_row %}

src/Symfony/Component/HttpFoundation/Session/Session.php

Lines changed: 3 additions & 1 deletion
8000
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ public function registerBag(SessionBagInterface $bag)
253253
*/
254254
public function getBag($name)
255255
{
256-
return $this->storage->getBag($name)->getBag();
256+
$bag = $this->storage->getBag($name);
257+
258+
return method_exists($bag, 'getBag') ? $bag->getBag() : $bag;
257259
}
258260

259261
/**

src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
1616
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
1717
use Symfony\Component\HttpFoundation\Session\Session;
18+
use Symfony\Component\HttpFoundation\Session\SessionBagProxy;
1819
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
1920

2021
/**
@@ -260,4 +261,28 @@ public function testIsEmpty()
260261
$flash->get('hello');
261262
$this->assertTrue($this->session->isEmpty());
262263
}
264+
265+
public function testGetBagWithBagImplementingGetBag()
266+
{
267+
$bag = new AttributeBag();
268+
$bag->setName('foo');
269+
270+
$storage = new MockArraySessionStorage();
271+
$storage->registerBag($bag);
272+
273+
$this->assertSame($bag, (new Session($storage))->getBag('foo'));
274+
}
275+
276+
public function testGetBagWithBagNotImplementingGetBag()
277+
{
278+
$data = [];
279+
280+
$bag = new AttributeBag();
281+
$bag->setName('foo');
282+
283+
$storage = new MockArraySessionStorage();
284+
$storage->registerBag(new SessionBagProxy($bag, $data, $usageIndex));
285+
286+
$this->assertSame($bag, (new Session($storage))->getBag('foo'));
287+
}
263288
}

src/Symfony/Component/Lock/Store/RedisStore.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public function save(Key $key)
7171
$this->checkNotExpired($key);
7272
}
7373

74+
/**
75+
* {@inheritdoc}
76+
*/
7477
public function waitAndSave(Key $key)
7578
{
7679
throw new InvalidArgumentException(sprintf('The store "%s" does not supports blocking locks.', \get_class($this)));

0 commit comments

Comments
 (0)
0