Skip to content

Commit

Permalink
chore: fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
shpran committed Nov 15, 2024
1 parent e3906af commit e69f8d8
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 18 deletions.
14 changes: 9 additions & 5 deletions migrations/Version202106011320101488_taoAdvancedSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

final class Version202106011320101488_taoAdvancedSearch extends AbstractMigration
{

public function getDescription(): string
{
return 'Adds task queue for indexation events.';
Expand All @@ -26,10 +25,15 @@ public function up(Schema $schema): void
$this->propagate($registrationService);
$registrationService->__invoke([]);

if ( BrokerFactory::BROKER_MEMORY !== $this->getAssocitationService()->guessDefaultBrokerType()){
$this->addReport(Report::createWarning(
sprintf('New worker must be created to proceed tasks from queue named `%s`',$registrationService->getQueueName())
));
if (BrokerFactory::BROKER_MEMORY !== $this->getAssocitationService()->guessDefaultBrokerType()) {
$this->addReport(
Report::createWarning(
sprintf(
'New worker must be created to proceed tasks from queue named `%s`',
$registrationService->getQueueName()
)
)
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion migrations/Version202209081525261488_taoAdvancedSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function up(Schema $schema): void

/** @var ServiceOptions $serviceOptions */
$serviceOptions = $this->getServiceManager()->get(ServiceOptions::SERVICE_ID);

if ($oldElasticSearch) {
$serviceOptions->save(ElasticSearchConfig::class, 'hosts', $oldElasticSearch->getOption('hosts'));
}
Expand Down
3 changes: 1 addition & 2 deletions model/Index/Report/IndexSummarizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ private function createReport(
string $label,
string $index,
int $totalInDb
): array
{
): array {
$totalIndexed = $this->getTotalResults($index);
$percentageIndexed = $totalIndexed === 0 || $totalInDb === 0
? 0
Expand Down
1 change: 0 additions & 1 deletion model/Metadata/Listener/MetadataInheritanceListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,4 @@ private function getIndexer(): IndexerInterface
);
return $indexer;
}

}
5 changes: 3 additions & 2 deletions model/Metadata/Repository/ClassUriCachedRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@

class ClassUriCachedRepository extends ConfigurableService implements ClassUriRepositoryInterface
{
use OntologyAwareTrait;

private const CLASSES_INDEX = self::class . '::CLASSES_URIS';
private const CLASSES_INDEX_TOTAL = self::class . '::CLASSES_URIS_TOTAL';

use OntologyAwareTrait;
private const CLASSES_INDEX_TOTAL = self::class . '::CLASSES_URIS_TOTAL';

public function cacheWarmup(): void
{
Expand Down
4 changes: 3 additions & 1 deletion model/Metadata/Service/AdvancedSearchSettingsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public function getSettingsByClassMetadataSearchRequest(
->getSettingsByClassMetadataSearchRequest($classMetadataSearchRequest);
}

$classCollection = $this->classMetadataSearcher->findAll(new ClassMetadataSearchInput($classMetadataSearchRequest));
$classCollection = $this->classMetadataSearcher->findAll(
new ClassMetadataSearchInput($classMetadataSearchRequest)
);

if ($classMetadataSearchRequest->getStructure() === 'results') {
return new SearchSettings(
Expand Down
4 changes: 2 additions & 2 deletions model/Metadata/Service/ClassMetadataSearcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

class ClassMetadataSearcher extends ConfigurableService implements ClassMetadataSearcherInterface
{
use OntologyAwareTrait;

private const BASE_LIST_ITEMS_URI = '/tao/PropertyValues/get?propertyUri=%s';

private const UNACCEPTABLE_PROPERTIES = [
Expand All @@ -50,8 +52,6 @@ class ClassMetadataSearcher extends ConfigurableService implements ClassMetadata
TaoOntology::PROPERTY_TRANSLATION_ORIGINAL_RESOURCE_URI,
];

use OntologyAwareTrait;

public function findAll(ClassMetadataSearchInput $input): ClassCollection
{
if ($this->getAdvancedSearchChecker()->isEnabled()) {
Expand Down
1 change: 1 addition & 0 deletions model/Metadata/ServiceProvider/MetadataServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use oat\taoAdvancedSearch\model\Metadata\Specification\PropertyAllowedSpecification;
use oat\taoAdvancedSearch\model\Resource\Service\ResourceIndexer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

use function Symfony\Component\DependencyInjection\Loader\Configurator\param;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private function logIndexFailure(
LoggerInterface $logger,
Throwable $e,
string $method,
string $script='',
string $script = '',
$type = null,
array $query = []
): void {
Expand Down
5 changes: 4 additions & 1 deletion scripts/tools/CacheWarmup.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ protected function run(): Report

$report->add(
Report::createSuccess(
sprintf('Cache warmed up! ROOT classUris (%s) in cache', implode(', ', $indexableClassRepository->findAllUris()))
sprintf(
'Cache warmed up! ROOT classUris (%s) in cache',
implode(', ', $indexableClassRepository->findAllUris())
)
)
);

Expand Down
4 changes: 2 additions & 2 deletions scripts/uninstall/UnRegisterTaskQueueServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public function __invoke($params)
return new Report(Report::TYPE_SUCCESS, 'Indexation TaskQueue `%s` was unregistered', $queueName);
}

private function getAssociationService(): QueueAssociationService{
private function getAssociationService(): QueueAssociationService
{
return $this->getServiceManager()->get(QueueAssociationService::class);
}

}

0 comments on commit e69f8d8

Please sign in to comment.