nette / php-generator

🐘 Generates neat PHP code for you. Supports new PHP 8.3 features.

Home Page:https://doc.nette.org/php-generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect method property mixed type generated from reflection

dakur opened this issue · comments

commented

Version: 3.5.1

Bug Description

class SomeClass {
  public function something(mixed $param) {}
}

// ClassType::withBodiesFrom(SomeClass::class) generates:

class SomeClass {
  public function something(?mixed $param) {}
}

which is incorrect as null is implicitly contained in mixed.

image