Skip to content
New issue

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

Dumping an array variable does not use the Printer's overridden indentation #41

Jeroeny opened this issue Jan 2, 2019 · 2 comments


Copy link

@Jeroeny Jeroeny commented Jan 2, 2019

php version: 7.3.0
nette/php-generator version: 3.2.1

Bug Description

When adding a constant to a class as below

$map = [
    'foo' => 'bar',
    'example' => 'value',

    ->addConstant('MAP', $map)

it results in:

    protected const MAP = [
	'foo' => 'bar',
	'example' => 'value',

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 Could we change it so that we can pass the indentation to the helper?

Copy link

@zeleznypa zeleznypa commented Jun 21, 2019

I also have this issue.

Copy link

@Jeroeny Jeroeny commented Jun 21, 2019

@zeleznypa I've worked around this with:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants