Run Rector on your code to see what it can do for you:
<?php #[ORM\Entity()] class DemoFile
#[ORM\Column()] #[ORM\GeneratedValue(strategy: 'AUTO')] protected ?int $id = null; - - #[ORM\Column(type: 'string', length: 300)] - protected string $category; - public function __construct(string $category) - { - $this->category = $category; + public function __construct(#[ORM\Column(type: 'string', length: 300)] + protected string $category) + { } }
Applied Rules:
Not a change you expect?
rector.php