php-code-generator icon indicating copy to clipboard operation
php-code-generator copied to clipboard

fix heredoc indent

Open stramunin opened this issue 7 years ago • 3 comments

Don't indent closing indetifier Heredoc

The closing identifier must begin in the first column of the line.(http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc)

stramunin avatar May 16 '17 14:05 stramunin

Looks good. Can you provide test cases? (I never use heredoc :p)

gossi avatar May 24 '17 08:05 gossi

In old project heredoc is often used. In one of the projects in which I participate, it is also used. Without this fix, the generated classes (with heredoc) will have a syntax error. I can write tests later.

stramunin avatar May 26 '17 12:05 stramunin

I'm wondering, whether the Writer is a good place to do that, since you tokenize the code. I would rather see this in two steps, keeping the writer as is?

Also please provide test cases. If this all comes down, I'd love to include this in v0.6.

gossi avatar Aug 04 '18 21:08 gossi