From 64863c9d4631c42d4ce3997d7033bca8f06ca66a Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Mon, 3 Feb 2025 15:34:01 +0100 Subject: chore: Apply new rector configuration to apps folder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/files/lib/Command/Scan.php | 7 ++++--- apps/files/lib/Command/ScanAppData.php | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'apps/files/lib/Command') diff --git a/apps/files/lib/Command/Scan.php b/apps/files/lib/Command/Scan.php index cf1cb04b9af..9c57f4b2971 100644 --- a/apps/files/lib/Command/Scan.php +++ b/apps/files/lib/Command/Scan.php @@ -24,6 +24,7 @@ use OCP\Files\NotFoundException; use OCP\Files\StorageNotAvailableException; use OCP\FilesMetadata\IFilesMetadataManager; use OCP\IUserManager; +use OCP\Server; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputArgument; @@ -102,8 +103,8 @@ class Scan extends Base { $scanner = new Scanner( $user, new ConnectionAdapter($connection), - \OC::$server->get(IEventDispatcher::class), - \OC::$server->get(LoggerInterface::class) + Server::get(IEventDispatcher::class), + Server::get(LoggerInterface::class) ); # check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception @@ -310,7 +311,7 @@ class Scan extends Base { protected function reconnectToDatabase(OutputInterface $output): Connection { /** @var Connection $connection */ - $connection = \OC::$server->get(Connection::class); + $connection = Server::get(Connection::class); try { $connection->close(); } catch (\Exception $ex) { diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php index 02f0977cba9..81c80cab373 100644 --- a/apps/files/lib/Command/ScanAppData.php +++ b/apps/files/lib/Command/ScanAppData.php @@ -18,6 +18,7 @@ use OCP\Files\Node; use OCP\Files\NotFoundException; use OCP\Files\StorageNotAvailableException; use OCP\IConfig; +use OCP\Server; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputArgument; @@ -70,8 +71,8 @@ class ScanAppData extends Base { $scanner = new Scanner( null, new ConnectionAdapter($connection), - \OC::$server->query(IEventDispatcher::class), - \OC::$server->get(LoggerInterface::class) + Server::get(IEventDispatcher::class), + Server::get(LoggerInterface::class) ); # check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception @@ -213,7 +214,7 @@ class ScanAppData extends Base { protected function reconnectToDatabase(OutputInterface $output): Connection { /** @var Connection $connection */ - $connection = \OC::$server->get(Connection::class); + $connection = Server::get(Connection::class); try { $connection->close(); } catch (\Exception $ex) { -- cgit v1.2.3