allow null value in fragment handler

This commit is contained in:
Kevin Bond 2014-01-18 16:41:55 -05:00 committed by Fabien Potencier
parent 2f8d4ad80c
commit c29958f82f

View File

@ -82,8 +82,8 @@ abstract class RoutableFragmentRenderer implements FragmentRendererInterface
foreach ($values as $key => $value) {
if (is_array($value)) {
$this->checkNonScalar($value);
} elseif (!is_scalar($value)) {
throw new \LogicException(sprintf('Controller attributes cannot contain non-scalar values (value for key "%s" is not a scalar).', $key));
} elseif (!is_scalar($value) && null !== $value) {
throw new \LogicException(sprintf('Controller attributes cannot contain non-scalar/non-null values (value for key "%s" is not a scalar or null).', $key));
}
}
}