We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
php version: 7.3.0 nette/php-generator version: 3.2.1
When adding a constant to a class as below
$map = [ 'foo' => 'bar', 'example' => 'value', ]; $class ->addConstant('MAP', $map) ->setVisibility(ClassType::VISIBILITY_PROTECTED);
it results in:
protected const MAP = [ 'foo' => 'bar', 'example' => 'value', ];
When printing with Nette\PhpGenerator\PsrPrinter.
Nette\PhpGenerator\PsrPrinter
The constant printed with PsrPrinter's 4 spaces indentation instead of tabs.
The tab is hardcoded at https://github.com/nette/php-generator/blob/master/src/PhpGenerator/Helpers.php#L74. Could we change it so that we can pass the indentation to the helper?
The text was updated successfully, but these errors were encountered:
I also have this issue.
Sorry, something went wrong.
@zeleznypa I've worked around this with:
Nette\PhpGenerator\Helpers::tabsToSpaces($contents);
aea6e81
No branches or pull requests
php version: 7.3.0
nette/php-generator version: 3.2.1
Bug Description
When adding a constant to a class as below
it results in:
When printing with
Nette\PhpGenerator\PsrPrinter
.Expected Behavior
The constant printed with PsrPrinter's 4 spaces indentation instead of tabs.
Possible Solution
The tab is hardcoded at https://github.com/nette/php-generator/blob/master/src/PhpGenerator/Helpers.php#L74. Could we change it so that we can pass the indentation to the helper?
The text was updated successfully, but these errors were encountered: