Add support for LocalStorage

Adding support for https://github.com/nelmio/NelmioApiDocBundle/issues/481

this variable should be kept inside the loop callback. There is no reason to define it in the parent scope