Skip to content
This repository was archived by the owner on Oct 11, 2021. It is now read-only.

syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')' #44

Closed
karlgray opened this issue Feb 6, 2020 · 4 comments
Closed

Comments

@karlgray
Copy link

karlgray commented Feb 6, 2020

I have done a clean install using php 7.4 and am getting this error in the browser.

syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')'
vendor/spatie/laravel-mailcoach/src/MailcoachServiceProvider.php:61

On the command line when running
php artisan migrate

I get this error.

Symfony\Component\Debug\Exception\FatalThrowableError : syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')'

at /var/www/vhosts/xxxxxx/yyyyyy/mailcoach/vendor/spatie/laravel-mailcoach/src/MailcoachServiceProvider.php:61
57| public function register()
58| {
59| $this->mergeConfigFrom(DIR . '/../config/mailcoach.php', 'mailcoach');
60|

61| $this->app->singleton(QueryString::class, fn () => new QueryString(urldecode($this->app->request->getRequestUri())));
62|
63| $this->app->singleton(Version::class, function () {
64| $httpClient = new HttpClient();
65|

Exception trace:

1 Composer\Autoload\includeFile("/var/www/vhosts/gray.me.uk/mailcoach.gray.me.uk/mailcoach/vendor/composer/../spatie/laravel-mailcoach/src/MailcoachServiceProvider.php")
/var/www/vhosts/gray.me.uk/mailcoach.gray.me.uk/mailcoach/vendor/composer/ClassLoader.php:322

2 Composer\Autoload\ClassLoader::loadClass("Spatie\Mailcoach\MailcoachServiceProvider")
[internal]:0

I am not a laravel developer just a normal user who wants to evaluate Mailcoach.

@ryancwalsh
Copy link

I'm not an expert and don't work for Spatie but wonder if this issue is happening: #10 (comment)

@freekmurze
Copy link
Member

freekmurze commented Feb 6, 2020

I suspect that you are not running PHP 7.4 for your web requests. Create a file called test.php in your public directory with this contents

<?php
phpinfo();

And verify the PHP version you are using.

If it's PHP 7.4, let me know and I'll reopen this issue.

@karlgray
Copy link
Author

karlgray commented Feb 6, 2020

Thank you both for your fast response.
Yes, it was plesk that was misreporting the version. changed it to 7.3 and back to 7.4 restarted nginx and all is fine now. Apologies and thanks.

@freekmurze
Copy link
Member

No apologies needed. Hope you'll enjoy Mailcoach.

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

No branches or pull requests

3 participants