<?php
namespace Alura\Doctrine\Entity;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
#[Entity]
class Student
{
#[Id]
#[GeneratedValue]
#[Column]
public readonly int $id;
public function __construct(
#[Column]
public readonly string $name
){
}
}
Com o código acima, recebo o seguinte erro quando dou o comando: php bin/doctrine.php orm:info
PHP Parse error: syntax error, unexpected identifier "int", expecting variable in /home/roms/Documents/PHP/Doctrine/src/Entity/Student.php on line 17