Update JsonSerializationVisitor.php

Fix JSON serialization of doctrine entity collections, when an entity could contain empty elements