title: How to have type hinting that work with class inheritance in PHP
body: <p>Lets say we have the following classes:</p>
  
  <pre><code>&lt;?php
  abstract class AnimalTrainer
  {
      abstract function train(Animal $animal);
  }
  
  class DogTrainer extends AnimalTrainer implements DogTrainerInterface
  {
      public function train(Animal $animal)
      {
          // code goes here
      }
  }
  
  interface DogTrainerInterface
  {
      public function train(Dog $animal)
  }
  
  # ==== Animal &amp; Dog ====
  class Animal
  {
  }
  
  class Dog extends Animal
  {
  }
  </code></pre>
  
  <p>All animal trainers can train animals, but Dog trainers can only train dogs. So the Interface for DogTrainer should state that. But that goes against the abstract declaration in AnimalTrainer since states the train method requires an Animal.</p>
  
  <p>Is there a way in PHP to make DogTrainers work with both the abstract class and the interface?</p>