ParseError: syntax error, unexpected 'DateFormatterInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)

Created on 27 December 2021, almost 4 years ago
Updated 4 September 2025, about 1 month ago

PHP7.4, Drupal 8.x latest version.
After composer update drupal/wisski and access /update.php, it shows error as below:
ParseError: syntax error, unexpected 'DateFormatterInterface' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /var/www/wisski/web/modules/contrib/wisski/wisski_core/src/Controller/WisskiEntityController.php on line 29 #0 [internal function]: Symfony\\Component\\ClassLoader\\ApcClassLoader->loadClass('Drupal\\\\wisski_c...')\n#1 [internal function]: spl_autoload_call('Drupal\\\\wisski_c...')\n#2 /var/www/wisski/web/core/lib/Drupal/Core/Entity/EntityResolverManager.php(136): ReflectionMethod->__construct('Drupal\\\\wisski_c...', 'add')\n#3 /var/www/wisski/web/core/lib/Drupal/Core/Entity/EntityResolverManager.php(221): Drupal\\Core\\Entity\\EntityResolverManager->setParametersFromReflection(Array, Object(Symfony\\Component\\Routing\\Route))\n#4 /var/www/wisski/web/core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php(48): Drupal\\Core\\Entity\\EntityResolverManager->setRouteOptions(Object(Symfony\\Component\\Routing\\Route))\n#5 [internal function]: Drupal\\Core\\EventSubscriber\\EntityRouteAlterSubscriber->onRoutingRouteAlterSetType(Object(Drupal\\Core\\Routing\\RouteBuildEvent), 'routing.route_a...', Object(Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))\n#6 /var/www/wisski/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Drupal\\Core\\Routing\\RouteBuildEvent), 'routing.route_a...', Object(Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))\n#7 /var/www/wisski/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(189): Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher->dispatch('routing.route_a...', Object(Drupal\\Core\\Routing\\RouteBuildEvent))\n#8 /var/www/wisski/web/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\\Core\\Routing\\RouteBuilder->rebuild()\n#9 /var/www/wisski/web/core/includes/common.inc(1090): Drupal\\Core\\ProxyClass\\Routing\\RouteBuilder->rebuild()\n#10 /var/www/wisski/web/core/modules/system/src/Controller/DbUpdateController.php(652): drupal_flush_all_caches()\n#11 /var/www/wisski/web/core/includes/batch.inc(456): Drupal\\system\\Controller\\DbUpdateController::batchFinished(true, Array, Array, Object(Drupal\\Core\\StringTranslation\\TranslatableMarkup))\n#12 /var/www/wisski/web/core/includes/batch.inc(98): _batch_finished()\n#13 /var/www/wisski/web/core/modules/system/src/Controller/DbUpdateController.php(185): _batch_page(Object(Symfony\\Component\\HttpFoundation\\Request))\n#14 [internal function]: Drupal\\system\\Controller\\DbUpdateController->handle('start', Object(Symfony\\Component\\HttpFoundation\\Request))\n#15 /var/www/wisski/web/core/lib/Drupal/Core/Update/UpdateKernel.php(115): call_user_func_array(Array, Array)\n#16 /var/www/wisski/web/core/lib/Drupal/Core/Update/UpdateKernel.php(76): Drupal\\Core\\Update\\UpdateKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request))\n#17 /var/www/wisski/web/update.php(28): Drupal\\Core\\Update\\UpdateKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#18 {main}

🐛 Bug report
Status

Closed: outdated

Version

3.4

Component

Code

Created by

🇨🇳China fishfree

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024