title: PHP getter/setter code completion in IDE
body: <p>I see getter and setter code that has been implemented as a implicit de facto standard in our PHP apps, to the effect that every instance variable in the project classes might as well be public.</p>
  
  <p>I don't want to see a list of getters and setters of every single instance variable in code every time I open a class. They're usually the first thing I see and usually the length of them surpasses the core content of the class which does something other than set and get, so I have to spend a minute scrolling like a muppet in a sea of getters and setters, especially when they are arranged like this:</p>
  
  <pre><code>$this-&gt;getter();
  $this-&gt;setter();
  $this-&gt;actualstuff();
  $this-&gt;getter();
  $this-&gt;setter();
  $this-&gt;getter();
  $this-&gt;getter();
  $this-&gt;setter();
  $this-&gt;actualstuff();
  $this-&gt;getter();
  $this-&gt;setter();
  </code></pre>
  
  <p>When I am on my death bed I will realize that half of my life will have been wasted looking at setters and getters, so I'm trying to appeal to my colleagues to not automatically generate them upon finishing instance variables out of habit and getting them pointlessly depended upon.</p>
  
  <p>The issue here is that my colleagues like that they appear in the IDE (we use PHPstorm) code completion, which makes things easier when typing out.</p>
  
  <p>I'm wondering if there is a technique to get getter code completion that doesn't use magic methods. A phpstorm plugin or PHP class perhaps.</p>
  
  <pre><code>class Product{
      private $price;
      private $amount;
  
      public function toGetter(){
          $return = array();
          $return['price'] = $this-&gt;price;
          $return['amount'] = $this-&gt;amount;
          $getter = new GetterObject($return); //Hypothetical solution class
          return $getter;
      }
  }
  
  $Product = new Product();
  $Product-&gt;toGetter()-&gt;getPrice(); //appears in PHPstorm code completion
  </code></pre>
  
  <p>I'll take any other kind of suggestion.</p>