title: get_class() expects parameter 1 to be object, null given
body: <p>I got this error in several places of code, when I tried to deploy Symfony 2.8 project on new local machine:</p>
  
  <pre><code>"Warning: get_class() expects parameter 1 to be object, null given"
  </code></pre>
  
  <p>Haven't find such case on stackoverflow and spent some time to figure out the reason.</p>