Skip to content

Commit

Permalink
Merge pull request #5 from ibexa/ibx-1334-cross-rebranding
Browse files Browse the repository at this point in the history
IBX-1334: Rebranded ibexa/solr to use new namespaces
  • Loading branch information
Nattfarinn authored Dec 3, 2021
2 parents 407c136 + 72c6503 commit 882b209
Show file tree
Hide file tree
Showing 256 changed files with 1,245 additions and 1,711 deletions.
25 changes: 25 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

use Ibexa\CodeStyle\PhpCsFixer\InternalConfigFactory;

$configFactory = new InternalConfigFactory();
$configFactory->withRules([
'declare_strict_types' => false,
]);

return $configFactory
->buildConfig()
->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->files()->name('*.php')
);
9 changes: 0 additions & 9 deletions .php_cs

This file was deleted.

12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
}
],
"require": {
"php": "^7.3",
"php": "^7.4",
"ext-json": "*",
"ezsystems/ezplatform-kernel": "^4.0@dev",
"ibexa/core": "^4.0@dev",
"netgen/query-translator": "^1.0.2",
"symfony/http-kernel": "^5.0",
"symfony/dependency-injection": "^5.0",
Expand All @@ -24,10 +24,10 @@
"symfony/framework-bundle": "^5.0"
},
"require-dev": {
"ezsystems/doctrine-dbal-schema": "^4.0@dev",
"ibexa/doctrine-schema": "^4.0@dev",
"phpunit/phpunit": "^8.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"ezsystems/ezplatform-code-style": "^0.1.0"
"ibexa/code-style": "^1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -51,8 +51,8 @@
}
},
"scripts": {
"fix-cs": "php-cs-fixer fix -v --show-progress=estimating",
"check-cs": "php-cs-fixer fix --dry-run -v --show-progress=estimating"
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",
"check-cs": "php-cs-fixer fix --dry-run -v --show-progress=dots"
},
"extra": {
"branch-alias": {
Expand Down
8 changes: 3 additions & 5 deletions src/bundle/ApiLoader/BoostFactorProviderFactory.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?php

/**
* This file is part of the eZ Platform Solr Search Engine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Solr\ApiLoader;

use eZ\Bundle\EzPublishCoreBundle\ApiLoader\RepositoryConfigurationProvider;
use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

Expand All @@ -20,7 +18,7 @@ class BoostFactorProviderFactory implements ContainerAwareInterface
use ContainerAwareTrait;

/**
* @var \eZ\Bundle\EzPublishCoreBundle\ApiLoader\RepositoryConfigurationProvider
* @var \Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider
*/
private $repositoryConfigurationProvider;

Expand Down
6 changes: 3 additions & 3 deletions src/bundle/ApiLoader/IndexingDepthProviderFactory.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\Bundle\Solr\ApiLoader;

use eZ\Bundle\EzPublishCoreBundle\ApiLoader\RepositoryConfigurationProvider;
use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

Expand All @@ -17,7 +17,7 @@ class IndexingDepthProviderFactory implements ContainerAwareInterface
use ContainerAwareTrait;

/**
* @var \eZ\Bundle\EzPublishCoreBundle\ApiLoader\RepositoryConfigurationProvider
* @var \Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider
*/
private $repositoryConfigurationProvider;

Expand Down
26 changes: 11 additions & 15 deletions src/bundle/ApiLoader/SolrEngineFactory.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
<?php

/**
* This file is part of the eZ Platform Solr Search Engine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*
* @version //autogentag//
*/
namespace Ibexa\Bundle\Solr\ApiLoader;

use eZ\Bundle\EzPublishCoreBundle\ApiLoader\RepositoryConfigurationProvider;
use eZ\Publish\SPI\Persistence\Content\Handler;
use Ibexa\Solr\CoreFilter\CoreFilterRegistry;
use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider;
use Ibexa\Contracts\Core\Persistence\Content\Handler;
use Ibexa\Contracts\Solr\DocumentMapper;
use Ibexa\Solr\CoreFilter\CoreFilterRegistry;
use Ibexa\Solr\Gateway\GatewayRegistry;
use Ibexa\Solr\ResultExtractor;

class SolrEngineFactory
{
/** @var \eZ\Bundle\EzPublishCoreBundle\ApiLoader\RepositoryConfigurationProvider */
/** @var \Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider */
private $repositoryConfigurationProvider;

/** @var string */
Expand All @@ -28,22 +24,22 @@ class SolrEngineFactory
/** @var string */
private $searchEngineClass;

/** @var \EzSystems\EzPlatformSolrSearchEngine\Gateway\GatewayRegistry */
/** @var \Ibexa\Solr\Gateway\GatewayRegistry */
private $gatewayRegistry;

/** @var \EzSystems\EzPlatformSolrSearchEngine\CoreFilter\CoreFilterRegistry */
/** @var \Ibexa\Solr\CoreFilter\CoreFilterRegistry */
private $coreFilterRegistry;

/** @var \eZ\Publish\SPI\Persistence\Content\Handler */
/** @var \Ibexa\Contracts\Core\Persistence\Content\Handler */
private $contentHandler;

/** @var \EzSystems\EzPlatformSolrSearchEngine\DocumentMapper */
/** @var \Ibexa\Contracts\Solr\DocumentMapper */
private $documentMapper;

/** @var \EzSystems\EzPlatformSolrSearchEngine\ResultExtractor */
/** @var \Ibexa\Solr\ResultExtractor */
private $contentResultExtractor;

/** @var \EzSystems\EzPlatformSolrSearchEngine\ResultExtractor */
/** @var \Ibexa\Solr\ResultExtractor */
private $locationResultExtractor;

public function __construct(
Expand Down
16 changes: 7 additions & 9 deletions src/bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php

/**
* This file is part of the eZ Platform Solr Search Engine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Solr\DependencyInjection;
Expand Down Expand Up @@ -113,14 +111,14 @@ protected function addConnectionsSection(ArrayNodeDefinition $node)
->prototype('array')
->beforeNormalization()
->ifTrue(
function ($v) {
static function ($v) {
return
!empty($v['mapping']) && !\is_array($v['mapping'])
;
}
)
->then(
function ($v) {
static function ($v) {
// If single endpoint is set for Content mapping, use it as default
// mapping for Content index
$v['mapping'] = [
Expand All @@ -133,7 +131,7 @@ function ($v) {
->end()
->beforeNormalization()
->ifTrue(
function ($v) {
static function ($v) {
return
empty($v['entry_endpoints']) &&
(
Expand All @@ -146,7 +144,7 @@ function ($v) {
)
->then(
// If entry endpoints are not provided use mapping endpoints
function ($v) {
static function ($v) {
$endpointSet = [];

if (!empty($v['mapping']['translations'])) {
Expand Down Expand Up @@ -315,7 +313,7 @@ function ($v) {
->useAttributeAsKey('content_type_identifier')
->beforeNormalization()
->always(
function (array $v) {
static function (array $v) {
$valuesMapped = [];
foreach ($v as $key => $value) {
if (\is_array($value)) {
Expand Down Expand Up @@ -351,7 +349,7 @@ function (array $v) {
->useAttributeAsKey('content_type_identifier')
->beforeNormalization()
->always(
function (array $v) {
static function (array $v) {
$valuesMapped = [];
foreach ($v as $key => $value) {
if (\is_array($value)) {
Expand Down
40 changes: 18 additions & 22 deletions src/bundle/DependencyInjection/IbexaSolrExtension.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
<?php

/**
* This file is part of the eZ Platform Solr Search Engine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*
* @version //autogentag//
*/
namespace Ibexa\Bundle\Solr\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\Config\FileLocator;

class IbexaSolrExtension extends Extension
{
Expand All @@ -25,7 +21,7 @@ class IbexaSolrExtension extends Extension
*
* @var string
*/
const ENGINE_ID = 'ezpublish.spi.search.solr';
public const ENGINE_ID = 'ezpublish.spi.search.solr';

/**
* Configured core gateway service ID.
Expand All @@ -34,7 +30,7 @@ class IbexaSolrExtension extends Extension
*
* @var string
*/
const GATEWAY_ID = 'ezpublish.search.solr.gateway.native';
public const GATEWAY_ID = 'ezpublish.search.solr.gateway.native';

/**
* Configured core filter service ID.
Expand All @@ -43,7 +39,7 @@ class IbexaSolrExtension extends Extension
*
* @var string
*/
const CORE_FILTER_ID = 'ezpublish.search.solr.core_filter.native';
public const CORE_FILTER_ID = 'ezpublish.search.solr.core_filter.native';

/**
* Configured core endpoint resolver service ID.
Expand All @@ -52,36 +48,36 @@ class IbexaSolrExtension extends Extension
*
* @var string
*/
const ENDPOINT_RESOLVER_ID = 'ezpublish.search.solr.gateway.endpoint_resolver.native';
public const ENDPOINT_RESOLVER_ID = 'ezpublish.search.solr.gateway.endpoint_resolver.native';

/**
* Endpoint class.
*
* @var string
*/
const ENDPOINT_CLASS = 'EzSystems\\EzPlatformSolrSearchEngine\\Gateway\\Endpoint';
public const ENDPOINT_CLASS = 'EzSystems\\EzPlatformSolrSearchEngine\\Gateway\\Endpoint';

/**
* Endpoint service tag.
*
* @var string
*/
const ENDPOINT_TAG = 'ezpublish.search.solr.endpoint';
public const ENDPOINT_TAG = 'ezpublish.search.solr.endpoint';

/**
* @var string
*/
const BOOST_FACTOR_PROVIDER_ID = 'ezpublish.search.solr.field_mapper.boost_factor_provider';
public const BOOST_FACTOR_PROVIDER_ID = 'ezpublish.search.solr.field_mapper.boost_factor_provider';

/**
* @var string
*/
const STANDALONE_DISTRIBUTION_STRATEGY_ID = 'ezpublish.search.solr.gateway.distribution_strategy.abstract_standalone';
public const STANDALONE_DISTRIBUTION_STRATEGY_ID = 'ezpublish.search.solr.gateway.distribution_strategy.abstract_standalone';

/**
* @var string
*/
const CLOUD_DISTRIBUTION_STRATEGY_ID = 'ezpublish.search.solr.gateway.distribution_strategy.abstract_cloud';
public const CLOUD_DISTRIBUTION_STRATEGY_ID = 'ezpublish.search.solr.gateway.distribution_strategy.abstract_cloud';

public function getAlias()
{
Expand All @@ -98,7 +94,7 @@ private function getServicePrefix(): string
* Loads a specific configuration.
*
* @param array $configs An array of configuration values
* @param ContainerBuilder $container A ContainerBuilder instance
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container A ContainerBuilder instance
*
* @throws \InvalidArgumentException When provided tag is not defined in this extension
*
Expand Down Expand Up @@ -173,7 +169,7 @@ protected function processConnectionConfiguration(ContainerBuilder $container, a
/**
* Creates needed search services for given connection name and parameters.
*
* @param ContainerBuilder $container
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
* @param string $connectionName
* @param array $connectionParams
*/
Expand Down Expand Up @@ -228,7 +224,7 @@ private function configureSearchServices(ContainerBuilder $container, $connectio
/**
* Creates boost factor map parameter for a given $connectionName.
*
* @param ContainerBuilder $container
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
* @param string $connectionName
* @param array $connectionParams
*/
Expand All @@ -244,7 +240,7 @@ private function configureBoostMap(ContainerBuilder $container, $connectionName,
/**
* Creates indexing depth map parameter for a given $connectionName.
*
* @param ContainerBuilder $container
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
* @param string $connectionName
* @param array $connectionParams
*/
Expand Down Expand Up @@ -285,7 +281,7 @@ public function getConfiguration(array $config, ContainerBuilder $container)
/**
* Builds boost factor map from the given $config.
*
* @see \EzSystems\EzPlatformSolrSearchEngine\FieldMapper\BoostFactorProvider::$map
* @see \Ibexa\Solr\FieldMapper\BoostFactorProvider::$map
*
* @param array $config
*
Expand Down
Loading

0 comments on commit 882b209

Please sign in to comment.