How can fix it (zend version 2.5) ?
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
I tried :
class TeacherControllerFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $name, array $options = null)
{
return new TeacherController(
$container->getServiceLocator()->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);
}
}
Have a look here. The patch is already merged. Here is the link to the patch.
This Link helped me to inject dependencies right.
You need add ~E_USER_DEPRECATED
You can add in the public/index.php
or
http://php.net/manual/en/errorfunc.constants.php