I want to mark a Doctrine entity $id field that is autogenerated by database engine as @var positive-int. However PHPStan complains.
class Entity
{
/**
* @var positive-int|null
*/
#[ORM\Column(type: 'integer', options: ['unsigned' => true])]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private ?int $id;
}
PHPStan output:
Property App\Rma\Domain\Rma\Rma::$id type mapping mismatch: database can contain int but property expects int<1, max>|null.