Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing comma in function calls, vendor/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php:51 #34235

Closed
mohamedziada opened this issue Sep 9, 2020 · 3 comments

Comments

@mohamedziada
Copy link

  • Laravel Version: 8.0.0
  • PHP Version: 7.3.20
  • Database Driver & Version: Mysql 8.0

Description:

Trailing comma in function calls

After create new project with Laravel 8, I found in Log file

[2020-09-09 17:06:14] local.ERROR: syntax error, unexpected ')' {
"exception":"[object] (ParseError(code: 0): syntax error, unexpected ')'
at /var/www/laravel8/vendor/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php:51)
[stacktrace]
#0 /var/www/laravel8/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/larave...')
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass('Illuminate\\Bus\\...')
#2 /var/www/laravel8/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(761): spl_autoload_call('Illuminate\\Bus\\...')
#3 /var/www/laravel8/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(741): Illuminate\Foundation\Application->registerDeferredProvider('Illuminate\\Bus\\...', 'Illuminate\\Bus\\...')
#4 /var/www/laravel8/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(717): Illuminate\Foundation\Application->loadDeferredProvider('Illuminate\\Bus\\...')
#5 /var/www/laravel8/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(313): Illuminate\Foundation\Application->loadDeferredProviders()
#6 /var/www/laravel8/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(127): Illuminate\Foundation\Console\Kernel->bootstrap()
#7 Command line code(1): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 {main}
"}


remove the comma from last argument

On line 50 at vendor/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php

Steps To Reproduce:

protected function registerBatchServices()
{
$this->app->singleton(BatchRepository::class, DatabaseBatchRepository::class);

    $this->app->singleton(DatabaseBatchRepository::class, function ($app) {
        return new DatabaseBatchRepository(
            $app->make(BatchFactory::class),
            $app->make('db')->connection(config('queue.batching.database')),
            config('queue.batching.table', 'job_batches')
        );
    });
}
@AegirLeet
Copy link
Contributor

Trailing commas in function calls are allowed from 7.3.0 on. You're probably (accidentally) using an older version of PHP.

@mohamedziada
Copy link
Author

Trailing commas in function calls are allowed from 7.3.0 on. You're probably (accidentally) using an older version of PHP.

PHP 7.3.20 (cli) (built: Jul 9 2020 23:50:54) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.20,

@AegirLeet
Copy link
Contributor

You might have multiple versions of PHP installed with the wrong one being used to run the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants