title: Should non-nullable entity properties be nullable type in PHP?
body: <p>Using Symfony 6.1, I have this Entity:</p>
  <pre class="lang-php prettyprint-override"><code>#[ORM\Entity(repositoryClass: InvoiceRepository::class)]
  class Invoice implements SearchableEntityInterface
  {
  
      #[ORM\Id]
      #[ORM\GeneratedValue]
      #[ORM\Column(type: 'integer')]
      private int $id;
  
      #[ORM\Column(type: 'datetime')]
      private DateTimeInterface $timeCreated;
  
      #[ORM\Column(type: 'datetime', nullable: true)]
      private ?DateTimeInterface $timePaid = null;
  
      // ...
  }
  </code></pre>
  <p>The only nullable field in DB is <code>timePaid</code>, the rest is required to be NOT NULL in DB.</p>
  <p>My code reflects &quot;nullability&quot; of DB in PHP code, i.e. if the field can be NULL in DB, then its nullable in PHP, but never otherwise.</p>
  <p>However when using the <code>make:entity</code> or checking online examples you always see</p>
  <pre class="lang-php prettyprint-override"><code>    #[ORM\Id]
      #[ORM\GeneratedValue]
      #[ORM\Column(type: 'integer')]
      private ?int $id;
  
      #[ORM\Column(type: 'datetime')]
      private ?DateTimeInterface $timeCreated;
  </code></pre>
  <p>i.e. nullable PHP properties even when it CANNOT be null ever.</p>
  <p><strong>Is it correct to declare ID field and non-nullable fields as non-nullable in PHP? Can there be any issues from this approach?</strong></p>