You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reserved word 'Abstract' used in PropertyEnumeration.php #102
Method OrderItem::setAttendeeDetailsRequired() expects an argument of type \OpenActive\Enums\PropertyEnumeration[] or null passing it an array of instances of Enums (GivenName & FamilyName) generates this syntax error:
PHP Parse error: syntax error, unexpected 'Abstract' (T_ABSTRACT), expecting identifier (T_STRING) in .../vendor/openactive/models/src/Enums/PropertyEnumeration.php on line 88
Line 88 of \OpenActive\Enums\PropertyEnumeration attempts to declare a const called Abstract, which isn't allowed.
After removing words which I feel are unlikely, the list is this:
abstract
break
case
catch
class
clone
const
continue
declare
default
extends
final
finally
for
global
implements
include
interface
list
namespace
new
print
private
protected
public
readonly
require
static
switch
throw
use
while
yield
We should put something in the model generator library to do something else here.
Activity
drinkynet commentedon Jun 8, 2022
It also doesn't like the use of Yield on line 1533
drinkynet commentedon Jun 8, 2022
Commenting out lines 88 and 1533 lets it work as a quick and dirty fix.
nathansalter commentedon Jun 8, 2022
This will also happen for any of the reserved PHP words https://www.php.net/manual/en/reserved.keywords.php
After removing words which I feel are unlikely, the list is this:
We should put something in the model generator library to do something else here.
nathansalter commentedon Jun 8, 2022
Worth noting that:
Works in PHP 8.0+, but fails in earlier PHP versions. Calling
$t = new OpenActive\Enums\PropertyEnumeration\Abstract;never works.