mirror of
https://github.com/nextcloud/server.git
synced 2026-04-02 23:55:54 -04:00
Merge pull request #54282 from nextcloud/techdebt/noid/reduce-deprecation-spam
This commit is contained in:
commit
3dac5b33ee
3 changed files with 6 additions and 5 deletions
|
|
@ -134,8 +134,7 @@ class App {
|
|||
$eventLogger->start('app:controller:dispatcher', 'Initialize dispatcher and pre-middleware');
|
||||
|
||||
// initialize the dispatcher and run all the middleware before the controller
|
||||
/** @var Dispatcher $dispatcher */
|
||||
$dispatcher = $container['Dispatcher'];
|
||||
$dispatcher = $container->get(Dispatcher::class);
|
||||
|
||||
$eventLogger->end('app:controller:dispatcher');
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ use Psr\Container\ContainerInterface;
|
|||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class DIContainer extends SimpleContainer implements IAppContainer {
|
||||
private string $appName;
|
||||
protected string $appName;
|
||||
private array $middleWares = [];
|
||||
private ServerContainer $server;
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
|||
$this->registerDeprecatedAlias('Dispatcher', Dispatcher::class);
|
||||
$this->registerService(Dispatcher::class, function (ContainerInterface $c) {
|
||||
return new Dispatcher(
|
||||
$c->get('Protocol'),
|
||||
$c->get(Http::class),
|
||||
$c->get(MiddlewareDispatcher::class),
|
||||
$c->get(IControllerMethodReflector::class),
|
||||
$c->get(IRequest::class),
|
||||
|
|
|
|||
|
|
@ -196,7 +196,9 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
|||
$this->registerService($alias, function (ContainerInterface $container) use ($target, $alias): mixed {
|
||||
try {
|
||||
$logger = $container->get(LoggerInterface::class);
|
||||
$logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
|
||||
$logger->debug('The requested alias "' . $alias . '" is deprecated. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', [
|
||||
'app' => $this->appName ?? 'serverDI',
|
||||
]);
|
||||
} catch (ContainerExceptionInterface $e) {
|
||||
// Could not get logger. Continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue