NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Question - Trait and code completion


Joined: 09 Feb 2017
Posts: 22
Reply with quote
Hello everyone,

Due to PHP not having multiple inheritance, I am using Trait for complex class composition where final interfaces for composed classes bring up features of many traits composed.

Alas in PHPEd editing trait does not allow you to see code completion from other classes (like possible parent class(es) for composed class) and their traits, code completion shows nothing from them for $this / self::

Thus the question, is there any way in PHPEd to hint classes and traits related to specific trait so they can be assumed local inside that trait for code completion? Maybe there's some specific comment hints syntax for that?

I.e.

Code:
class X {
  use Y;

  function someX($x, $y)
  {
      $this->someY($x, $y);
  }
}

trait Y {
  function someY($a, $b)
  {
    $this->someX($a, $b);
  }
}


When I edit class X, I obviously can see $this->someY() in code completion as trait Y is included.
But when I edit trait Y, I want to also see $this->someX() from class X, as trait is intended to be composed into X (or parent of X, or possibly with other traits that also need to be seen), but alas, I am missing a way for code completion to see it.
Thus I have to track calls that are supposed to exist in other levels of composition manually, and that's frustrating Smile
View user's profileFind all posts by Alex/ATSend private message
Question - Trait and code completion
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic