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

E_NOTICE with trait method aliases #15

Closed
weierophinney opened this issue Dec 31, 2019 · 2 comments
Closed

E_NOTICE with trait method aliases #15

weierophinney opened this issue Dec 31, 2019 · 2 comments
Assignees
Labels
Bug Something isn't working Won't Fix This will not be worked on
Milestone

Comments

@weierophinney
Copy link
Member

I'm getting Notice: Undefined offset: 1 in /path/to/vendor/zendframework/zend-code/src/Scanner/ClassScanner.php on line 596 using 3.1.0. It looks like this happens with aliased trait methods:

trait A 
{
    function a() {
        // does something
    }
}

class B 
{
    use A {
        a as b;
    }

    function a() {
        b();
        // do something more
    }
}

Stepping through the code it looks like $alias['original'] does not contain '::', causing the notice. I ran into this using zend-expressive-tooling on an existing project. It doesn't seem to cause anything other than annoyance, but I'm not sure if just adding a check for '::' would hide a deeper problem. Thoughts?


Originally posted by @kynx at zendframework/zend-code#104

@Ocramius
Copy link
Member

No longer needed as per #58

@Ocramius Ocramius self-assigned this Nov 30, 2020
@Ocramius Ocramius added Bug Something isn't working Won't Fix This will not be worked on labels Nov 30, 2020
@Ocramius Ocramius added this to the 4.0.0 milestone Nov 30, 2020
@kynx
Copy link

kynx commented Nov 30, 2020

Heavens to Betsy! I used to alias trait methods? What was wrong with me?!

Nice cleanup you’re doing @Ocramius 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Won't Fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants