use the same logic as symfony standard