Allow usage on older Symfony versions (2.1)

setCode only likes Closure objects, other callables are only supported in newer versions of Symfony.