Skip to content

Commit

Permalink
Merge pull request #875 from nextcloud/fix/noid/get-rid-of-ilogger
Browse files Browse the repository at this point in the history
get rid of ILogger
  • Loading branch information
ArtificialOwl authored Sep 23, 2024
2 parents ed5d191 + a9c9cbe commit edc742c
Show file tree
Hide file tree
Showing 25 changed files with 98 additions and 867 deletions.
40 changes: 4 additions & 36 deletions lib/Command/Check.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
declare(strict_types=1);


declare(strict_types=1);
/**
* FullTextSearch - Full text search framework for Nextcloud
*
Expand All @@ -27,54 +26,24 @@
*
*/


namespace OCA\FullTextSearch\Command;


use Exception;
use OC\Core\Command\Base;
use OCA\FullTextSearch\Service\ConfigService;
use OCA\FullTextSearch\Service\MiscService;
use OCA\FullTextSearch\Service\PlatformService;
use OCA\FullTextSearch\Service\ProviderService;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;


class Check extends Base {

/** @var ConfigService */
private $configService;

/** @var PlatformService */
private $platformService;

/** @var ProviderService */
private $providerService;

/** @var MiscService */
private $miscService;


/**
* Index constructor.
*
* @param ConfigService $configService
* @param PlatformService $platformService
* @param ProviderService $providerService
* @param MiscService $miscService
*/
public function __construct(
ConfigService $configService, PlatformService $platformService,
ProviderService $providerService, MiscService $miscService
private ConfigService $configService,
private PlatformService $platformService,
private ProviderService $providerService
) {
parent::__construct();

$this->configService = $configService;
$this->platformService = $platformService;
$this->providerService = $providerService;
$this->miscService = $miscService;
}


Expand All @@ -97,7 +66,6 @@ protected function configure() {
* @throws Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): int {

if ($input->getOption('json') === true) {
$output->writeln(json_encode($this->displayAsJson(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));

Expand Down
33 changes: 4 additions & 29 deletions lib/Command/Configure.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
declare(strict_types=1);


declare(strict_types=1);
/**
* FullTextSearch - Full text search framework for Nextcloud
*
Expand All @@ -27,44 +26,20 @@
*
*/


namespace OCA\FullTextSearch\Command;


use Exception;
use OC\Core\Command\Base;
use OCA\FullTextSearch\Service\ConfigService;
use OCA\FullTextSearch\Service\MiscService;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;


/**
* Class Configure
*
* @package OCA\FullTextSearch\Command
*/
class Configure extends Base {

/** @var ConfigService */
private $configService;

/** @var MiscService */
private $miscService;


/**
* Index constructor.
*
* @param ConfigService $configService
* @param MiscService $miscService
*/
public function __construct(ConfigService $configService, MiscService $miscService) {
public function __construct(
private ConfigService $configService
) {
parent::__construct();

$this->configService = $configService;
$this->miscService = $miscService;
}


Expand Down
39 changes: 3 additions & 36 deletions lib/Command/DocumentIndex.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
declare(strict_types=1);


declare(strict_types=1);
/**
* FullTextSearch - Full text search framework for Nextcloud
*
Expand All @@ -27,54 +26,23 @@
*
*/


namespace OCA\FullTextSearch\Command;


use Exception;
use OC\Core\Command\Base;
use OCA\FullTextSearch\Model\Index;
use OCA\FullTextSearch\Service\MiscService;
use OCA\FullTextSearch\Service\PlatformService;
use OCA\FullTextSearch\Service\ProviderService;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;


/**
* Class DocumentIndex
*
* @package OCA\FullTextSearch\Command
*/
class DocumentIndex extends Base {


/** @var ProviderService */
private $providerService;

/** @var PlatformService */
private $platformService;

/** @var MiscService */
private $miscService;


/**
* DocumentIndex constructor.
*
* @param ProviderService $providerService
* @param PlatformService $platformService
* @param MiscService $miscService
*/
public function __construct(
ProviderService $providerService, PlatformService $platformService, MiscService $miscService
private ProviderService $providerService,
private PlatformService $platformService
) {
parent::__construct();

$this->providerService = $providerService;
$this->platformService = $platformService;
$this->miscService = $miscService;
}


Expand All @@ -90,7 +58,6 @@ protected function configure() {
->addArgument('documentId', InputArgument::REQUIRED, 'documentId');
}


/**
* @param InputInterface $input
* @param OutputInterface $output
Expand Down
29 changes: 4 additions & 25 deletions lib/Command/DocumentPlatform.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
declare(strict_types=1);


declare(strict_types=1);
/**
* FullTextSearch - Full text search framework for Nextcloud
*
Expand All @@ -27,41 +26,21 @@
*
*/


namespace OCA\FullTextSearch\Command;


use Exception;
use OC\Core\Command\Base;
use OCA\FullTextSearch\Service\MiscService;
use OCA\FullTextSearch\Service\PlatformService;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;


class DocumentPlatform extends Base {


/** @var PlatformService */
private $platformService;

/** @var MiscService */
private $miscService;


/**
* Index constructor.
*
* @param PlatformService $providerService
* @param MiscService $miscService
*/
public function __construct(PlatformService $providerService, MiscService $miscService) {
public function __construct(
private PlatformService $providerService
) {
parent::__construct();

$this->platformService = $providerService;
$this->miscService = $miscService;
}


Expand Down
33 changes: 3 additions & 30 deletions lib/Command/DocumentProvider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
declare(strict_types=1);


declare(strict_types=1);
/**
* FullTextSearch - Full text search framework for Nextcloud
*
Expand All @@ -27,49 +26,23 @@
*
*/


namespace OCA\FullTextSearch\Command;


use Exception;
use OC\Core\Command\Base;
use OCA\FullTextSearch\Model\Index;
use OCA\FullTextSearch\Service\MiscService;
use OCA\FullTextSearch\Service\ProviderService;
use OCP\FullTextSearch\Model\IIndexDocument;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;


/**
* Class DocumentProvider
*
* @package OCA\FullTextSearch\Command
*/
class DocumentProvider extends Base {


/** @var ProviderService */
private $providerService;

/** @var MiscService */
private $miscService;


/**
* Index constructor.
*
* @param ProviderService $providerService
* @param MiscService $miscService
*/
public function __construct(ProviderService $providerService, MiscService $miscService
public function __construct(
private ProviderService $providerService
) {
parent::__construct();

$this->providerService = $providerService;
$this->miscService = $miscService;
}


Expand Down
38 changes: 6 additions & 32 deletions lib/Command/DocumentStatus.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

<?php

declare(strict_types=1);
/**
* FullTextSearch - Full text search framework for Nextcloud
*
Expand All @@ -26,57 +26,31 @@
*
*/


namespace OCA\FullTextSearch\Command;


use Exception;
use OC\Core\Command\Base;
use OCA\FullTextSearch\Exceptions\IndexDoesNotExistException;
use OCA\FullTextSearch\Service\IndexService;
use OCA\FullTextSearch\Service\MiscService;
use OCP\FullTextSearch\Model\IIndex;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;


/**
* Class DocumentStatus
*
* @package OCA\FullTextSearch\Command
*/
class DocumentStatus extends Base {


/** @var IndexService */
private $indexService;

/** @var MiscService */
private $miscService;

/** @var array */
private $statusAvailable = [
private array $statusAvailable = [
'IGNORE' => 'document will never be indexed',
'INDEX' => 'document will be indexed',
'DONE' => 'document is well indexed',
'REMOVE' => 'document will be removed',
'FAILED' => 'index had fail'
];


/**
* DocumentStatus constructor.
*
* @param IndexService $indexService
* @param MiscService $miscService
*/
public function __construct(IndexService $indexService, MiscService $miscService) {
public function __construct(
private IndexService $indexService
) {
parent::__construct();

$this->indexService = $indexService;
$this->miscService = $miscService;
}


Expand Down
Loading

0 comments on commit edc742c

Please sign in to comment.