Skip to content

Commit

Permalink
chore: Migrate from ILogger to LoggerInterface
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Sep 19, 2024
1 parent bf781ba commit 64f3386
Show file tree
Hide file tree
Showing 28 changed files with 21 additions and 119 deletions.
1 change: 0 additions & 1 deletion lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public function boot(IBootContext $context): void {
$c->query(IServerContainer::class)->getRootFolder(),
\OCP\Server::get(PhotofilesService::class),
\OCP\Server::get(TracksService::class),
$c->query(IServerContainer::class)->getLogger(),
$c->query('AppName'),
$c->query(IServerContainer::class)->getLockingProvider()
);
Expand Down
5 changes: 0 additions & 5 deletions lib/Controller/ContactsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@
use OCP\Files\NotFoundException;
use OCP\IAvatarManager;
use OCP\IDBConnection;
use OCP\ILogger;
use OCP\IRequest;
use OCP\IURLGenerator;
use Sabre\VObject\Property\Text;
use Sabre\VObject\Reader;

class ContactsController extends Controller {
private $userId;
private $logger;
private $contactsManager;
private $addressService;
private $dbconnection;
Expand All @@ -45,7 +43,6 @@ class ContactsController extends Controller {

/**
* @param $AppName
* @param ILogger $logger
* @param IRequest $request
* @param IDBConnection $dbconnection
* @param IManager $contactsManager
Expand All @@ -57,7 +54,6 @@ class ContactsController extends Controller {
*/
public function __construct(
$AppName,
ILogger $logger,
IRequest $request,
IDBConnection $dbconnection,
IManager $contactsManager,
Expand All @@ -68,7 +64,6 @@ public function __construct(
IRootFolder $root,
IURLGenerator $urlGenerator) {
parent::__construct($AppName, $request);
$this->logger = $logger;
$this->userId = $UserId;
$this->avatarManager = $avatarManager;
$this->contactsManager = $contactsManager;
Expand Down
9 changes: 0 additions & 9 deletions lib/Controller/DevicesApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,16 @@
namespace OCA\Maps\Controller;

use OCA\Maps\Service\DevicesService;

use OCP\App\IAppManager;
use OCP\AppFramework\ApiController;

use OCP\AppFramework\Http;


use OCP\AppFramework\Http\DataResponse;
use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IRequest;
use OCP\IServerContainer;
use OCP\IUserManager;

use OCP\Share\IManager;

class DevicesApiController extends ApiController {
Expand All @@ -43,7 +37,6 @@ class DevicesApiController extends ApiController {
private $dbdblquotes;
private $defaultDeviceId;
private $l;
private $logger;
private $devicesService;
protected $appName;

Expand All @@ -56,15 +49,13 @@ public function __construct($AppName,
IUserManager $userManager,
IGroupManager $groupManager,
IL10N $l,
ILogger $logger,
DevicesService $devicesService,
$UserId) {
parent::__construct($AppName, $request,
'PUT, POST, GET, DELETE, PATCH, OPTIONS',
'Authorization, Content-Type, Accept',
1728000);
$this->devicesService = $devicesService;
$this->logger = $logger;
$this->appName = $AppName;
$this->appVersion = $config->getAppValue('maps', 'installed_version');
$this->userId = $UserId;
Expand Down
6 changes: 0 additions & 6 deletions lib/Controller/DevicesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@
use OCP\IDateTimeZone;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IRequest;
use OCP\IServerContainer;

use OCP\IUserManager;

use OCP\Share\IManager;

//use function \OCA\Maps\Service\endswith;
Expand All @@ -48,7 +45,6 @@ class DevicesController extends Controller {
private $dbdblquotes;
private $defaultDeviceId;
private $l;
private $logger;
private $devicesService;
private $deviceShareMapper;
private $dateTimeZone;
Expand All @@ -64,7 +60,6 @@ public function __construct($AppName,
IUserManager $userManager,
IGroupManager $groupManager,
IL10N $l,
ILogger $logger,
DevicesService $devicesService,
DeviceShareMapper $deviceShareMapper,
IDateTimeZone $dateTimeZone,
Expand All @@ -74,7 +69,6 @@ public function __construct($AppName,
$this->devicesService = $devicesService;
$this->deviceShareMapper = $deviceShareMapper;
$this->dateTimeZone = $dateTimeZone;
$this->logger = $logger;
$this->appName = $AppName;
$this->appVersion = $config->getAppValue('maps', 'installed_version');
$this->userId = $UserId;
Expand Down
4 changes: 0 additions & 4 deletions lib/Controller/FavoritesApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IRequest;
use OCP\IServerContainer;
use OCP\IUserManager;
Expand All @@ -37,7 +36,6 @@ class FavoritesApiController extends ApiController {
private $dbdblquotes;
private $defaultDeviceId;
private $l;
private $logger;
private $favoritesService;
protected $appName;

Expand All @@ -50,15 +48,13 @@ public function __construct($AppName,
IUserManager $userManager,
IGroupManager $groupManager,
IL10N $l,
ILogger $logger,
FavoritesService $favoritesService,
$UserId) {
parent::__construct($AppName, $request,
'PUT, POST, GET, DELETE, PATCH, OPTIONS',
'Authorization, Content-Type, Accept',
1728000);
$this->favoritesService = $favoritesService;
$this->logger = $logger;
$this->appName = $AppName;
$this->appVersion = $config->getAppValue('maps', 'installed_version');
$this->userId = $UserId;
Expand Down
4 changes: 0 additions & 4 deletions lib/Controller/FavoritesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use OCP\IDateTimeZone;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IRequest;
use OCP\IServerContainer;
use OCP\IUserManager;
Expand All @@ -44,7 +43,6 @@ class FavoritesController extends Controller {
private IGroupManager $groupManager;
private string $dbtype;
private IL10N $l;
private ILogger $logger;
private FavoritesService $favoritesService;
private IDateTimeZone $dateTimeZone;
private ?string $defaultFavoritsJSON;
Expand All @@ -62,15 +60,13 @@ public function __construct($AppName,
IUserManager $userManager,
IGroupManager $groupManager,
IL10N $l,
ILogger $logger,
FavoritesService $favoritesService,
IDateTimeZone $dateTimeZone,
FavoriteShareMapper $favoriteShareMapper,
$UserId) {
parent::__construct($AppName, $request);
$this->favoritesService = $favoritesService;
$this->dateTimeZone = $dateTimeZone;
$this->logger = $logger;
$this->appName = $AppName;
$this->appVersion = $config->getAppValue('maps', 'installed_version');
$this->userId = $UserId;
Expand Down
5 changes: 0 additions & 5 deletions lib/Controller/PhotosController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,21 @@
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;

use OCP\ILogger;
use OCP\IRequest;

class PhotosController extends Controller {
private $userId;
private $geophotoService;
private $photofilesService;
private $logger;
private $root;

public function __construct($AppName,
ILogger $logger,
IRequest $request,
GeophotoService $GeophotoService,
PhotofilesService $photofilesService,
IRootFolder $root,
$UserId) {
parent::__construct($AppName, $request);
$this->logger = $logger;
$this->userId = $UserId;
$this->geophotoService = $GeophotoService;
$this->photofilesService = $photofilesService;
Expand Down
4 changes: 0 additions & 4 deletions lib/Controller/PublicFavoritePageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@
use OCP\AppFramework\Http\Template\PublicTemplateResponse;
use OCP\AppFramework\PublicShareController;
use OCP\IConfig;
use OCP\ILogger;
use OCP\IRequest;
use OCP\ISession;
use OCP\IUserManager;
use OCP\Util;

class PublicFavoritePageController extends PublicShareController {
private $config;
private $logger;

/* @var FavoriteShareMapper */
private $favoriteShareMapper;
Expand All @@ -50,12 +48,10 @@ public function __construct(
IRequest $request,
ISession $session,
IConfig $config,
ILogger $logger,
FavoriteShareMapper $favoriteShareMapper
) {
parent::__construct($appName, $request, $session);
$this->config = $config;
$this->logger = $logger;
$this->favoriteShareMapper = $favoriteShareMapper;
}

Expand Down
2 changes: 0 additions & 2 deletions lib/Controller/PublicFavoritesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use OCP\IUserManager;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager;
use Psr\Log\LoggerInterface;

class PublicFavoritesController extends PublicPageController {

Expand Down Expand Up @@ -61,7 +60,6 @@ public function __construct(
IUserManager $userManager,
IGroupManager $groupManager,
IL10N $l,
private LoggerInterface $logger,
FavoritesService $favoritesService,
IDateTimeZone $dateTimeZone,
FavoriteShareMapper $favoriteShareMapper,
Expand Down
4 changes: 0 additions & 4 deletions lib/Controller/PublicTracksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use OCP\IGroupManager;
use OCP\IInitialStateService;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IRequest;
use OCP\IServerContainer;
use OCP\ISession;
Expand All @@ -39,7 +38,6 @@ class PublicTracksController extends PublicPageController {
protected ShareManager $shareManager;
protected IUserManager $userManager;
protected IL10N $l;
protected ILogger $logger;
protected TracksService $tracksService;
protected $appName;
protected IRootFolder $root;
Expand All @@ -57,12 +55,10 @@ public function __construct(
IServerContainer $serverContainer,
protected IGroupManager $groupManager,
IL10N $l,
ILogger $logger,
TracksService $tracksService,
IRootFolder $root) {
parent::__construct($appName, $request, $session, $urlGenerator, $eventDispatcher, $config, $initialStateService, $shareManager, $userManager);
$this->tracksService = $tracksService;
$this->logger = $logger;
$this->l = $l;
$this->root = $root;
}
Expand Down
8 changes: 0 additions & 8 deletions lib/Controller/RoutingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@

use OCA\Maps\Service\TracksService;
use OCP\App\IAppManager;

use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;



use OCP\IConfig;
use OCP\IDateTimeZone;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IRequest;
use OCP\IServerContainer;
use OCP\IUserManager;
Expand All @@ -42,7 +37,6 @@ class RoutingController extends Controller {
private $dbdblquotes;
private $defaultDeviceId;
private $l;
private $logger;
private $dateTimeZone;
private $tracksService;
protected $appName;
Expand All @@ -56,12 +50,10 @@ public function __construct($AppName,
IUserManager $userManager,
IGroupManager $groupManager,
IL10N $l,
ILogger $logger,
IDateTimeZone $dateTimeZone,
TracksService $tracksService,
$UserId) {
parent::__construct($AppName, $request);
$this->logger = $logger;
$this->dateTimeZone = $dateTimeZone;
$this->appName = $AppName;
$this->appVersion = $config->getAppValue('maps', 'installed_version');
Expand Down
9 changes: 0 additions & 9 deletions lib/Controller/TracksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,15 @@
namespace OCA\Maps\Controller;

use OCA\Maps\Service\TracksService;

use OCP\App\IAppManager;
use OCP\AppFramework\Controller;



use OCP\AppFramework\Http\DataResponse;
use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IRequest;
use OCP\IServerContainer;
use OCP\IUserManager;

use OCP\Share\IManager;

use function OCA\Maps\Helper\remove_utf8_bom;
Expand All @@ -43,7 +37,6 @@ class TracksController extends Controller {
private $dbtype;
private $dbdblquotes;
private $l;
private $logger;
private $tracksService;
protected $appName;

Expand All @@ -56,12 +49,10 @@ public function __construct($AppName,
IUserManager $userManager,
IGroupManager $groupManager,
IL10N $l,
ILogger $logger,
TracksService $tracksService,
$UserId) {
parent::__construct($AppName, $request);
$this->tracksService = $tracksService;
$this->logger = $logger;
$this->appName = $AppName;
$this->appVersion = $config->getAppValue('maps', 'installed_version');
$this->userId = $UserId;
Expand Down
Loading

0 comments on commit 64f3386

Please sign in to comment.