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

Support configuring spaces between methods #30

Closed deviantintegral closed 6 years ago

deviantintegral commented 6 years ago

I see that nette places two spaces between methods which is fine, but doesn't match most other PHP projects. This PR makes the spacing configurable while leaving the default at 2 spaces.

dg commented 6 years ago

I added the PsrPrinter that solves this issue:

$printer = new Nette\PhpGenerator\PsrPrinter;

$class = new Nette\PhpGenerator\ClassType('Demo');
// ...

echo $printer->printClass($class); // 4 spaces indentation