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

Fixed mixed implicit nullability (closes #74) #75

Closed dakur closed 3 years ago

dakur commented 3 years ago
dakur commented 3 years ago

Not sure if more places are affected, I've fixed only this one.

dg commented 3 years ago

It will probably also apply to properties and return values, right?

Will it work with uppercase 'MIXED'?

dakur commented 3 years ago

Frankly said, I have no idea. 🤷‍♂️ I just wanted to sketch where the problem lies and what looks like solution. But I don't know the code base much (or at all), so I rather pass it on people more familiar with it.

dg commented 3 years ago

fixed

dakur commented 3 years ago

@dg It is not fixed in 3.5.2. Probably something got wrong when rebasing? Factory#fromMethodReflection() still relies on allowsNull()

dakur commented 3 years ago

Aha, there should be probably ! strcmp() in here: https://github.com/nette/php-generator/blob/41dcc5d1cb322835e5950a76515166c90923c6b7/src/PhpGenerator/Printer.php#L296

dakur commented 3 years ago

@dg Ok, it works, sorry, I've screwed up my expected test file during previous testing.