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

ParseError: syntax error, unexpected 'public' (T_PUBLIC), expecting case (T_CASE) or default (T_DEFAULT) or '}' in #2915

Closed
2 of 6 tasks
lindiii opened this issue Jun 19, 2023 · 1 comment

Comments

@lindiii
Copy link

lindiii commented Jun 19, 2023

Please check these things before submitting your issue:

  • Read the error message you're seeing - it often tells you what is wrong, and may contain useful links & instructions
  • Make sure you're using the latest version of PHPMailer
  • Check that your problem is not dealt with in the troubleshooting guide, especially if you're having problems connecting to Gmail or GoDaddy
  • Include sufficient code to reproduce your problem
  • If you're having an SMTP issue, include the debug output generated with SMTPDebug = 2 set
  • If you have a question about how to use PHPMailer (rather than reporting a bug in it), tag a question on Stack Overflow with phpmailer, but search first!

Problem description

[Mon Jun 19 09:58:14.390312 2023] [php7:notice] [pid 1695] [client 172.68.50.218:43152] ParseError: syntax error, unexpected 'public' (T_PUBLIC), expecting case (T_CASE) or default (T_DEFAULT) or '}' in /var/www/example.shop/public/app/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php:2850\nStack trace:\n
#0 /var/www/example.shop/public/app/lib/vendor/composer/ClassLoader.php(344): Composer\\Autoload\\includeFile('/var/www/example...')\n
#1 [internal function]: Composer\\Autoload\\ClassLoader->loadClass('PHPMailer\\\\PHPMa...')\n#2 /var/www/example.shop/public/app/Tygh/Mailer/Transports/PhpMailerTransport.php(33): spl_autoload_call('PHPMailer\\\\PHPMa...')\n
#3 /var/www/example.shop/public/app/lib/vendor/composer/ClassLoader.php(476): include('/var/www/example...')\n
#4 /var/www/example.shop/public/app/lib/vendor/composer/ClassLoader.php(344): Composer\\Autoload\\includeFile('/var/www/example...')\n
#5 [internal function]: Composer\\Autoload\\ClassLoader->loadClass('Tygh\\\\Mailer\\\\Tra...')\n
#6 /var/www/example.shop/public/app/Tygh/Providers/MailerProvider.php(64): spl_autoload_call('Tygh\\\\Mailer\\\\Tra...')\n
#7 /var/www/example.shop/public/app/Tygh/Mailer/TransportFactory.php(74): Tygh\\Providers\\MailerProvider::Tygh\\Providers\\{closure}(Array)\n
#8 /var/www/example.shop/public/app/Tygh/Mailer/Mailer.php(142): Tygh\\Mailer\\TransportFactory->createTransport('smtp', Array)\n
#9 /var/www/example.shop/public/app/Tygh/Mailer/Mailer.php(74): Tygh\\Mailer\\Mailer->getTransport(Array)\n
#10 /var/www/example.shop/public/app/Tygh/Providers/MailerProvider.php(54): Tygh\\Mailer\\Mailer->__construct(Object(Tygh\\Mailer\\MessageBuilderFactory), Object(Tygh\\Mailer\\TransportFactory), Array, true)\n
#11 /var/www/example.shop/public/app/lib/vendor/pimple/pimple/src/Pimple/Container.php(118): Tygh\\Providers\\MailerProvider::Tygh\\Providers\\{closure}(Object(Tygh\\Application))\n
#12 /var/www/example.shop/public/app/Tygh/Application.php(135): Pimple\\Container->offsetGet('mailer')\n
#13 /var/www/example.shop/public/app/Tygh/Providers/EventDispatcherProvider.php(224): Tygh\\Application->offsetGet('mailer')\n#14 /var/www/example.shop/public/app/lib/vendor/pimple/pimple/src/Pimple/Container.php(118): Tygh\\Providers\\EventDispatcherProvider->Tygh\\Providers\\{closure}(Object(Tygh\\Application))\n
#15 /var/www/example.shop/public/app/Tygh/Application.php(135): Pimple\\Container->offsetGet('event.transport...')\n
#16 /var/www/example.shop/public/app/Tygh/Notifications/Transports/TransportFactory.php(43): Tygh\\Application->offsetGet('event.transport...')\n
#17 /var/www/example.shop/public/app/Tygh/Notifications/EventDispatcher.php(109): Tygh\\Notifications\\Transports\\TransportFactory->create('mail')\n
#18 /var/www/example.shop/public/app/functions/fn.cart.php(2850): Tygh\\Notifications\\EventDispatcher->dispatch('order.status_ch...', Object(Tygh\\Notifications\\Data), Object(Tygh\\Notifications\\Settings\\Ruleset), Object(Tygh\\Notifications\\EventIdProviders\\OrderProvider))\n
#19 /var/www/example.shop/public/app/functions/fn.cart.php(1596): fn_change_order_status(2075, 'O', 'N', Array, true)\n
#20 /var/www/example.shop/public/app/functions/fn.cart.php(10129): fn_place_order(Array, Array)\n
#21 /var/www/example.shop/public/app/controllers/frontend/checkout.php(397): fn_checkout_place_order(Array, Array, Array)\n#22 /var/www/example.shop/public/app/functions/fn.control.php(722): include('/var/www/example...')\n
#23 /var/www/example.shop/public/app/functions/fn.control.php(458): fn_run_controller('/var/www/example...', 'checkout', 'place_order', '', '')\n
#24 /var/www/example.shop/public/index.php(25): fn_dispatch()\n#25 {main}, referer: https://example.com/checkout/

Code to reproduce

Debug output

@Synchro
Copy link
Member

Synchro commented Jun 19, 2023

There's not enough info to go on here. PHPMailer does not cause this error by itself, so the problem must lie elsewhere. It also looks like you're running PHP 7.4, which, while it is supported by PHPMailer, is no longer a maintained version of PHP.

@Synchro Synchro closed this as completed Jun 19, 2023
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