title: ZF2 : ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0
body: <p>How can fix it (zend version 2.5) ?</p>
  
  <p>ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0, along with the ServiceLocatorAwareInitializer. Please update your class Teacher\Controller\TeacherController to remove the implementation, and start injecting your dependencies via factory instead</p>
  
  <p>I tried :</p>
  
  <pre><code>class TeacherControllerFactory implements FactoryInterface
      {
          public function __invoke(ContainerInterface $container, $name, array $options = null)
          {
              return new TeacherController(
                  $container-&gt;getServiceLocator()-&gt;get(TeacherService::class)
              );
          }
  
          /**
           * Create and return TeacherController instance
           *
           * For use with zend-servicemanager v2; proxies to __invoke().
           *
           * @param ServiceLocatorInterface $container
           * @return TeacherController
           */
          public function createService(ServiceLocatorInterface $container)
          {
              return $this($container, TeacherController::class);
          }
      }
  </code></pre>