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

Remove superfluous trailing line in trait usage generated code #146

Merged
merged 2 commits into from
Sep 13, 2022

Conversation

dsavina
Copy link
Contributor

@dsavina dsavina commented Sep 8, 2022

Q A
Bugfix yes
BC Break no

Description

This is a minor codestyle fix regarding the trait usage generated code when providing either aliases or replacements for a trait.

Let's consider following example script:

$class = new ClassGenerator('Talker');
$class->addTrait('A');
$class->addTrait('B');
$class->addTraitAlias('B::smallTalk', 'gossip');
$class->addTraitOverride('A::bigTalk', 'B');

echo $class->generate();

As of now, the output will be (note the double line break after the insteadof statement):

class Talker
{
    use A, B {
        B::smallTalk as gossip;
        A::bigTalk insteadof B;

    }
}

With present patch, generated code will now be:

class Talker
{
    use A, B {
        B::smallTalk as gossip;
        A::bigTalk insteadof B;
    }
}

Verified

This commit was signed with the committer’s verified signature. The key has expired.
mtorromeo Massimiliano Torromeo
Signed-off-by: Dorian Savina <d.savina@thecodingmachine.com>
Signed-off-by: Dorian Savina <d.savina@thecodingmachine.com>
@Ocramius Ocramius added this to the 4.7.0 milestone Sep 13, 2022
@Ocramius Ocramius self-assigned this Sep 13, 2022
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dsavina!

@Ocramius Ocramius merged commit 0337d92 into laminas:4.7.x Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants