Remove trailing comma from method calls for PHP 7.2 support