Open drinkynet opened 2 years ago
It also doesn't like the use of Yield on line 1533
Commenting out lines 88 and 1533 lets it work as a quick and dirty fix.
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:
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.
Worth noting that:
$v = new OpenActive\Enums\PropertyEnumeration\GivenName;
Works in PHP 8.0+, but fails in earlier PHP versions. Calling $t = new OpenActive\Enums\PropertyEnumeration\Abstract;
never works.
Method
OrderItem::setAttendeeDetailsRequired()
expects an argument of type\OpenActive\Enums\PropertyEnumeration[]
ornull
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.