Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,23 @@
"ext-xmlwriter": "*",
"ibexa/core": "~5.0.x-dev",
"netgen/query-translator": "^1.0.2",
"symfony/http-kernel": "^6.4",
"symfony/dependency-injection": "^6.4",
"symfony/console": "^6.4",
"symfony/config": "^6.4",
"symfony/framework-bundle": "^6.4",
"symfony/http-client": "^6.4"
"symfony/config": "^7.2",
"symfony/console": "^7.2",
"symfony/dependency-injection": "^7.2",
"symfony/framework-bundle": "^7.2",
"symfony/http-client": "^7.2",
"symfony/http-kernel": "^7.2"
},
"require-dev": {
"ibexa/code-style": "~2.0.0",
"ibexa/doctrine-schema": "~5.0.x-dev",
"ibexa/rector": "~5.0.x-dev",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"matthiasnoback/symfony-dependency-injection-test": "^5.0",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-symfony": "^2.0",
"phpunit/phpunit": "^9.6",
"symfony/phpunit-bridge": "^6.4",
"symfony/proxy-manager-bridge": "^6.4"
"symfony/phpunit-bridge": "^7.2"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 0 additions & 5 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ includes:
- phpstan-baseline.neon

parameters:
ignoreErrors:
-
message: "#^Cannot call method (fetchOne|fetchAll|fetchAllAssociative|fetchAssociative|fetchAllKeyValue)\\(\\) on Doctrine\\\\DBAL\\\\ForwardCompatibility\\\\Result\\|int\\|string\\.$#"
paths:
- tests/*
level: 8
paths:
- src
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
convertWarningsToExceptions="true">
<php>
<ini name="error_reporting" value="-1" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[indirect]=92"/>
</php>
<testsuites>
<testsuite name="Solr search engine tests">
Expand Down
15 changes: 5 additions & 10 deletions src/bundle/ApiLoader/BoostFactorProviderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@
namespace Ibexa\Bundle\Solr\ApiLoader;

use Ibexa\Contracts\Core\Container\ApiLoader\RepositoryConfigurationProviderInterface;
use Ibexa\Solr\FieldMapper\BoostFactorProvider;
use LogicException;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* BoostFactorProvider service factory takes into account boost factor semantic configuration.
*/
class BoostFactorProviderFactory implements ContainerAwareInterface
class BoostFactorProviderFactory
{
use ContainerAwareTrait;
private ContainerInterface $container;

private RepositoryConfigurationProviderInterface $repositoryConfigurationProvider;

Expand All @@ -37,21 +34,19 @@ class BoostFactorProviderFactory implements ContainerAwareInterface
* @param string $boostFactorProviderClass
*/
public function __construct(
ContainerInterface $container,
RepositoryConfigurationProviderInterface $repositoryConfigurationProvider,
$defaultConnection,
$boostFactorProviderClass
) {
$this->container = $container;
$this->repositoryConfigurationProvider = $repositoryConfigurationProvider;
$this->defaultConnection = $defaultConnection;
$this->boostFactorProviderClass = $boostFactorProviderClass;
}

public function buildService()
{
if ($this->container === null) {
throw new LogicException(sprintf('Unable to build %s due to missing container reference', BoostFactorProvider::class));
}

$repositoryConfig = $this->repositoryConfigurationProvider->getRepositoryConfig();

$connection = $this->defaultConnection;
Expand Down
15 changes: 5 additions & 10 deletions src/bundle/ApiLoader/IndexingDepthProviderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
namespace Ibexa\Bundle\Solr\ApiLoader;

use Ibexa\Contracts\Core\Container\ApiLoader\RepositoryConfigurationProviderInterface;
use Ibexa\Solr\FieldMapper\IndexingDepthProvider;
use LogicException;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\DependencyInjection\ContainerInterface;

class IndexingDepthProviderFactory implements ContainerAwareInterface
class IndexingDepthProviderFactory
{
use ContainerAwareTrait;
private ContainerInterface $container;

private RepositoryConfigurationProviderInterface $repositoryConfigurationProvider;

Expand All @@ -25,21 +22,19 @@ class IndexingDepthProviderFactory implements ContainerAwareInterface
private string $indexingDepthProviderClass;

public function __construct(
ContainerInterface $container,
RepositoryConfigurationProviderInterface $repositoryConfigurationProvider,
string $defaultConnection,
string $indexingDepthProviderClass
) {
$this->container = $container;
$this->repositoryConfigurationProvider = $repositoryConfigurationProvider;
$this->defaultConnection = $defaultConnection;
$this->indexingDepthProviderClass = $indexingDepthProviderClass;
}

public function buildService()
{
if ($this->container === null) {
throw new LogicException(sprintf('Unable to build %s due to missing container reference', IndexingDepthProvider::class));
}

$repositoryConfig = $this->repositoryConfigurationProvider->getRepositoryConfig();

$connection = $this->defaultConnection;
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/IbexaSolrBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ public function getContainerExtension(): ?ExtensionInterface
$this->extension = new IbexaSolrExtension();
}

return $this->extension;
return $this->extension ?: null;
}
}
8 changes: 3 additions & 5 deletions src/bundle/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,17 @@ services:

Ibexa\Bundle\Solr\ApiLoader\BoostFactorProviderFactory:
arguments:
- '@service_container'
- '@Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider'
- "%ibexa.solr.default_connection%"
- Ibexa\Solr\FieldMapper\BoostFactorProvider
calls:
- [setContainer, ["@service_container"]]
- 'Ibexa\Solr\FieldMapper\BoostFactorProvider'

Ibexa\Bundle\Solr\ApiLoader\IndexingDepthProviderFactory:
arguments:
- '@service_container'
- '@Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider'
- "%ibexa.solr.default_connection%"
- Ibexa\Solr\FieldMapper\IndexingDepthProvider
calls:
- [setContainer, ["@service_container"]]

Ibexa\Solr\FieldMapper\IndexingDepthProvider:
class: Ibexa\Solr\FieldMapper\IndexingDepthProvider
Expand Down
6 changes: 2 additions & 4 deletions src/lib/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
use Ibexa\Contracts\Core\Persistence\Content\ContentInfo;
use Ibexa\Contracts\Core\Persistence\Handler as PersistenceHandler;
use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException;
use Ibexa\Contracts\Core\Search\Handler as SearchHandler;
use Ibexa\Core\Search\Common\IncrementalIndexer;
use Ibexa\Solr\Handler as SolrSearchHandler;
use Psr\Log\LoggerInterface;

class Indexer extends IncrementalIndexer
{
/**
* @var \Ibexa\Solr\Handler
*/
protected $searchHandler;
protected SearchHandler $searchHandler;

public function __construct(
LoggerInterface $logger,
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/SetupFactory/LegacySetupFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
namespace Ibexa\Tests\Solr\SetupFactory;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\FetchMode;
use Ibexa\Bundle\Solr\DependencyInjection\IbexaSolrExtension;
use Ibexa\Contracts\Core\Persistence\Content\Handler;
use Ibexa\Contracts\Core\Repository\Repository;
use Ibexa\Contracts\Core\Test\Repository\SetupFactory\Legacy as CoreLegacySetupFactory;
use Ibexa\Core\Base\Container\Compiler\Search\AggregateFieldValueMapperPass;
use Ibexa\Core\Base\Container\Compiler\Search\FieldRegistryPass;
Expand Down Expand Up @@ -49,7 +49,7 @@ public function __construct()
*
* @return \Ibexa\Contracts\Core\Repository\Repository
*/
public function getRepository($initializeFromScratch = true)
public function getRepository($initializeFromScratch = true): Repository
{
// Load repository first so all initialization steps are done
$repository = parent::getRepository($initializeFromScratch);
Expand Down Expand Up @@ -133,7 +133,7 @@ protected function indexAll(): void
->select('id')
->from(ContentGateway::CONTENT_ITEM_TABLE);

$contentIds = array_map('intval', $query->execute()->fetchAll(FetchMode::COLUMN));
$contentIds = array_map('intval', $query->executeQuery()->fetchFirstColumn());

$contentItems = $contentHandler->loadContentList($contentIds);

Expand Down
Loading