Just a clarification: It is ServiceLocator that is going to be deprecated, not ServiceManager, is that correct?
So in my factory, this will still be ok (not an anti-pattern), right?
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
/** @var ServiceManager $sm */
$sm = $container; // let's call it what it is
/** @var SomeModel $model */
$model = $sm->get(SomeModel::class);
return new MyModel($model);
}