Skip to content

Add Missing Properties transformation not working as expected in Traits #726

Closed

Description

@dshoreman

Summary

When I :call phpactor#Transform("add_missing_properties") (or hit a on the Transform prompt) while in a Trait, it adds a new class. When performing the same action from a class, it works as expected.

Expected Behaviour

Phpactor adds a new private property to the trait.

Actual Behaviour

It creates an entirely new class matching the name of the trait and adds the property there instead.

Example

phpactor-traitbug

Activity

  1. dshoreman commented on Jan 29, 2019

    @dshoreman
    ContributorAuthor

    After a few hours yesterday digging around, I was able to track the issue down to the code-transform repo and in turn found code-builder was lacking Trait support.

    I've been able to fix locally so I'll open PRs on the respective repositories soon. While I've added some tests, it's still a work in progress and could likely use some feedback on potential refactoring and extra tests.

    With everything split between at least two repos, hopefully this issue will help to keep everything tied together in one place.

    Side note: I tried to join the Slack linked at the bottom of the README before opening this, but the invite link has expired. Is it still in use? Edit: Found new Slack link. PR at #727

  2. changed the title [-]Add Missing Properties transformation not working as expected on Traits[/-] [+]Add Missing Properties transformation not working as expected in Traits[/+] on Jan 29, 2019
  3. dantleech commented on Jan 29, 2019

    @dantleech
    Collaborator

    Great, feel free to ping me on Slack :)

  4. added 2 commits that reference this issue on Jan 30, 2019
    105b38c
    fbc4a39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions