nette / php-generator

🐘 Generates neat PHP code for you. Supports new PHP 8.3 features.
https://doc.nette.org/php-generator
Other
2.11k stars 138 forks source link

Incorrect method property mixed type generated from reflection #74

Closed dakur closed 3 years ago

dakur commented 3 years ago

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