[HttpKernel] Arrays with scalar values passed to ESI fragment renderer throw deprecation notice
This commit is contained in:
parent
020d78a65b
commit
d84b47fe9d
@ -98,8 +98,8 @@ abstract class AbstractSurrogateFragmentRenderer extends RoutableFragmentRendere
|
||||
private function containsNonScalars(array $values)
|
||||
{
|
||||
foreach ($values as $value) {
|
||||
if (is_array($value) && $this->containsNonScalars($value)) {
|
||||
return true;
|
||||
if (is_array($value)) {
|
||||
return $this->containsNonScalars($value);
|
||||
} elseif (!is_scalar($value) && null !== $value) {
|
||||
return true;
|
||||
}
|
||||
|
@ -34,7 +34,15 @@ class EsiFragmentRendererTest extends TestCase
|
||||
{
|
||||
$strategy = new EsiFragmentRenderer(new Esi(), $this->getInlineStrategy(true), new UriSigner('foo'));
|
||||
$request = Request::create('/');
|
||||
$reference = new ControllerReference('main_controller', array('foo' => array('a' => array(), 'b' => new \stdClass())), array());
|
||||
$reference = new ControllerReference('main_controller', array('foo' => new \stdClass()), array());
|
||||
$strategy->render($reference, $request);
|
||||
}
|
||||
|
||||
public function testRenderFallbackWithScalarIsNotDeprecated()
|
||||
{
|
||||
$strategy = new EsiFragmentRenderer(new Esi(), $this->getInlineStrategy(true), new UriSigner('foo'));
|
||||
$request = Request::create('/');
|
||||
$reference = new ControllerReference('main_controller', array('foo' => array(true)), array());
|
||||
$strategy->render($reference, $request);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user