title: Dynamically declared fields in Kohana
body: <p>I’ve been building an application with Kohana 3.3, and recently switched development from Coda 2 — a text editor — to PhpStorm 6 — an IDE.</p>
  
  <p>PhpStorm 6 has been very handy in pointing out potential code smells; it prompted me to move from attaching data to views with the <code>__set($key, $value)</code> magic method to instead using the <code>bind($key, $value)</code> method.</p>
  
  <p>Another thing that PhpStorm 6 is complaining about, is that I’m declaring fields dynamically.</p>
  
  <p>I have subclassed <code>Controller_Template</code>, and I’m attaching my view to my template like this:</p>
  
  <pre><code>public function action_index() {
      # Create the view
      $view = View::factory('project/list');
  
      # Attach the view to the template
      $this-&gt;template-&gt;content = $view;
  }
  </code></pre>
  
  <p>Apparently, <code>content</code> is declared dynamically. I’ve been checking up the class heirarchy, and I can't find the <code>content</code> property declared anywhere (hence why it’s dynamic, I suppose). Is this a code smell? Is dynamic declaration bad? Can I explicitly declare the <code>content</code> property somewhere?</p>
  
  <p>As it is, the code works. I just want to understand <em>why</em> PhpStorm is giving me a notice, and whether or not I’m going about things the right way. </p>