question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[php] typing parent:: does not provide methods of the parent's trait

See original GitHub issue

Apache NetBeans version

Latest release

What happened

Netbeans does not show the methods of a trait used by a parent class in the auto completion context.

How to reproduce

Create a PHP file and insert following code:

<?php

trait T {
    protected function foo() {}
}
class A {
    use T;
    protected function shownFnc() {}
}
class B extends A {
    protected function foo() {
        parent:: // <-- place your cursor here
    }
}

Now place your cursor at the hinted line and hit ctrl + space keys. Now, the auto complete menu shows the shownFnc method, but not foo.

Did this work correctly in an earlier version?

  • This used to work!

Operating System

Debian 10.11, Linux version 4.19.0-14-amd64

JDK

11.0.12; OpenJDK 64-Bit Server VM 11.0.12+7

Apache NetBeans packaging

Other

Anything else

Netbeans is installed via flatpak

Are you willing to submit a pull request?

  • Yes I am willing to submit a PR!

Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
junichi11commented, Jan 25, 2022

Will look at it later. Thanks.

1reaction
naitsirchcommented, Jan 28, 2022

@junichi11 Great! Thank you very much 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object Inheritance - Manual - PHP
Private methods of a parent class are not accessible to a child class. As a result, child classes may reimplement a private method...
Read more >
PHP trait: is there a proper way to ensure that class using a ...
So my question is: Is there a way to ensure (at compile time, not at runtime) that class which uses a certain trait...
Read more >
php - Should a trait refer to parent methods?
It's fine if a trait depends on methods in the class into which it is embedded. But these dependencies should be explicit, by...
Read more >
tighten/parental: Use single table inheritance in your Laravel ...
Parental is a Laravel package that brings STI (Single Table Inheritance) ... By adding the HasChildren trait and a type column to the...
Read more >
Twin Studies: A Unique Epidemiological Tool - PMC - NCBI
Twin studies are a special type of epidemiological studies designed to measure the contribution of genetics as opposed to the environment, to a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found