Skip to content

Adding new nodes probably breaks spacings #426

@TomasVotruba

Description

@TomasVotruba

Hi!

I'm performing transformating from Pseudo_Namespace to Namespace (basically inversion of your tutorial).

And I need to add Namespace_ node in afterTraverse() method.

All works fine, node is added on right position. But issue is, all spaces are wiped.

In examples:

Before

<?php declare(strict_types=1);

class PHPUnit_TestCase
{
}

After

<?php

declare(strict_types=1);
namespace PHPUnit; // this line was added!
class TestCase
{
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions