4141use OCP \AppFramework \Bootstrap \IBootContext ;
4242use OCP \AppFramework \Bootstrap \IBootstrap ;
4343use OCP \AppFramework \Bootstrap \IRegistrationContext ;
44- use OCP \AppFramework \IAppContainer ;
4544use OCP \IL10N ;
45+ use OCP \IServerContainer ;
46+ use Psr \Container \ContainerInterface ;
4647
4748class Application extends App implements IBootstrap {
4849 public function __construct () {
@@ -52,17 +53,17 @@ public function __construct() {
5253 /**
5354 * Controller
5455 */
55- $ container ->registerService ('RenewPasswordController ' , function (IAppContainer $ c ) {
56- /** @var \OC\Server $server */
57- $ server = $ c ->query ( ' ServerContainer ' );
56+ $ container ->registerService ('RenewPasswordController ' , function (ContainerInterface $ c ) {
57+ /** @var IServerContainer $server */
58+ $ server = $ c ->get (IServerContainer::class );
5859
5960 return new RenewPasswordController (
60- $ c ->getAppName ( ),
61+ $ c ->get ( ' AppName ' ),
6162 $ server ->getRequest (),
62- $ c ->query ('UserManager ' ),
63+ $ c ->get ('UserManager ' ),
6364 $ server ->getConfig (),
64- $ c ->query (IL10N ::class),
65- $ c ->query ('Session ' ),
65+ $ c ->get (IL10N ::class),
66+ $ c ->get ('Session ' ),
6667 $ server ->getURLGenerator ()
6768 );
6869 });
@@ -114,13 +115,15 @@ public function boot(IBootContext $context): void {
114115 );
115116 }
116117
117- public function registerBackendDependents (IAppContainer $ appContainer ) {
118- $ appContainer ->getServer ()->getEventDispatcher ()->addListener (
118+ public function registerBackendDependents (ContainerInterface $ appContainer ) {
119+ /** @var IServerContainer $serverContainer */
120+ $ serverContainer = $ appContainer ->get (IServerContainer::class);
121+ $ serverContainer ->getEventDispatcher ()->addListener (
119122 'OCA \\Files_External::loadAdditionalBackends ' ,
120123 function () use ($ appContainer ) {
121- $ storagesBackendService = $ appContainer ->query (BackendService::class);
124+ $ storagesBackendService = $ appContainer ->get (BackendService::class);
122125 $ storagesBackendService ->registerConfigHandler ('home ' , function () use ($ appContainer ) {
123- return $ appContainer ->query (ExtStorageConfigHandler::class);
126+ return $ appContainer ->get (ExtStorageConfigHandler::class);
124127 });
125128 }
126129 );
0 commit comments