ParseError: syntax error, unexpected '|', expecting ';' or '{'

Created on 8 July 2023, over 1 year ago
Updated 13 July 2023, over 1 year ago

Problem/Motivation

Drupal 8.9.11
Module generates the following error:

ParseError: syntax error, unexpected '|', expecting ';' or '{' in Composer\Autoload\includeFile() (line 76 of [server path...]/modules/contrib/content_export_csv/src/ContentExport.php)

The affected line of code reads:
public function getNodeIds(string $nodeType, int $status = 1): int|array {

Steps to reproduce

1. Instal module via compose
2. Enable
3. Go to /admin/content/content-export - it generates the above error

Proposed resolution

Fix the code

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇬🇧United Kingdom gebiss

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

Comments & Activities

Production build 0.71.5 2024