Codeception / Codeception

Full-stack testing PHP framework
http://codeception.com
MIT License
4.75k stars 1.3k forks source link

generate:cest: Adding `declare(strict_types=1);` and return type `void` to generated files #6736

Open ThomasLandauer opened 4 months ago

TavoNiievez commented 4 months ago

In the past I was against adding : void at the end of methods because it doesn't add anything relevant to the tests and because it can make the suite tests harder to read. Strict types were also suggested by me, but it was also not decided to add them. I even suggested that Cest should be 'final' classes, but again, the simpler the default generated code the better I guess was the reasoning.

ThomasLandauer commented 4 months ago

Well, you can certainly see it as noise. But that's the way that PHP has been taking over the last view years.

My main argument is: That's the way good PHP code should look nowadays, so we should gently guide people to this direction. And the generated files are just a suggestion - anybody can easily delete the stuff they don't want.