Skip to content

Commit

Permalink
change namespace of DocumentInterface and related classes
Browse files Browse the repository at this point in the history
  • Loading branch information
limenet committed Apr 7, 2023
1 parent 35dbfec commit bae361b
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Simplified, these are the steps to get the bundle up and running:
1. Configure the Elasticsearch client in `app/config/config.yml`
2. Define the mapping between an Elasticsearch document and a Pimcore element by implementing `\Valantic\ElasticaBridgeBundle\DocumentType\DocumentInterface`
3. Define the Elasticsearch index by implementing `\Valantic\ElasticaBridgeBundle\Index\IndexInterface`
4. Define how a document is persisted in an index by implementing `\Valantic\ElasticaBridgeBundle\DocumentType\Index\IndexDocumentInterface`
4. Define how a document is persisted in an index by implementing `\Valantic\ElasticaBridgeBundle\Document\IndexDocumentInterface`

## Indexing

Expand Down
6 changes: 3 additions & 3 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ parameters:
path: src/Command/Refresh.php

-
message: "#^Method Valantic\\\\ElasticaBridgeBundle\\\\DocumentType\\\\Index\\\\AbstractDocument\\:\\:getListingClass\\(\\) should return class\\-string but returns string\\.$#"
message: "#^Method Valantic\\\\ElasticaBridgeBundle\\\\Document\\\\AbstractDocument\\:\\:getListingClass\\(\\) should return class\\-string but returns string\\.$#"
count: 1
path: src/DocumentType/Index/AbstractDocument.php
path: src/Document/AbstractDocument.php

-
message: "#^Method Valantic\\\\ElasticaBridgeBundle\\\\Repository\\\\DocumentRepository\\:\\:__construct\\(\\) has parameter \\$documents with no value type specified in iterable type iterable\\.$#"
count: 1
path: src/Repository/DocumentRepository.php

-
message: "#^Property Valantic\\\\ElasticaBridgeBundle\\\\Repository\\\\DocumentRepository\\:\\:\\$documents \\(array\\<Valantic\\\\ElasticaBridgeBundle\\\\DocumentType\\\\Index\\\\DocumentInterface\\>\\) does not accept array\\<string, object\\>\\.$#"
message: "#^Property Valantic\\\\ElasticaBridgeBundle\\\\Repository\\\\DocumentRepository\\:\\:\\$documents \\(array\\<Valantic\\\\ElasticaBridgeBundle\\\\Document\\\\DocumentInterface\\>\\) does not accept array\\<string, object\\>\\.$#"
count: 1
path: src/Repository/DocumentRepository.php

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Valantic\ElasticaBridgeBundle\DocumentType\Index\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Document\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Index\IndexInterface;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Valantic\ElasticaBridgeBundle\DocumentType\Index;
namespace Valantic\ElasticaBridgeBundle\Document;

use Pimcore\Model\DataObject;
use Pimcore\Model\Listing\AbstractListing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Valantic\ElasticaBridgeBundle\DocumentType\Index;
namespace Valantic\ElasticaBridgeBundle\Document;

use Pimcore\Localization\LocaleService;
use Pimcore\Model\DataObject\AbstractObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

declare(strict_types=1);

namespace Valantic\ElasticaBridgeBundle\DocumentType\Index;
namespace Valantic\ElasticaBridgeBundle\Document;

use Elastica\Document;
use Valantic\ElasticaBridgeBundle\Enum\DocumentType;
use Pimcore\Model\Element\AbstractElement;
use Pimcore\Model\Listing\AbstractListing;
use Valantic\ElasticaBridgeBundle\Command\Index as IndexCommand;
use Valantic\ElasticaBridgeBundle\DocumentType\AbstractDocument;
use Valantic\ElasticaBridgeBundle\DocumentType\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Index\IndexInterface;

/**
Expand All @@ -21,15 +18,15 @@
interface DocumentInterface
{
/**
* Every Elasticsearch document will contain a __type field, corresponding to DocumentInterface::getType().
* Every Elasticsearch document will contain a __type field, corresponding to self::getType().
*/
public const META_TYPE = '__type';
/**
* Every Elasticsearch document will contain a __subType field, corresponding to DocumentInterface::getSubType().
* Every Elasticsearch document will contain a __subType field, corresponding to self::getSubType().
*/
public const META_SUB_TYPE = '__subType';
/**
* Every Elasticsearch document will contain an __id field, corresponding to DocumentInterface::getPimcoreId().
* Every Elasticsearch document will contain an __id field, corresponding to self::getPimcoreId().
*/
public const META_ID = '__id';
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Valantic\ElasticaBridgeBundle\DocumentType\Index;
namespace Valantic\ElasticaBridgeBundle\Document;

use Pimcore\Model\DataObject\Concrete;
use Pimcore\Model\DataObject\Folder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Valantic\ElasticaBridgeBundle\DocumentType\Index;
namespace Valantic\ElasticaBridgeBundle\Document;

use Elastica\Query\BoolQuery;
use Elastica\Query\MatchQuery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Valantic\ElasticaBridgeBundle\DocumentType\Index;
namespace Valantic\ElasticaBridgeBundle\Document;

interface TenantAwareInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Valantic\ElasticaBridgeBundle\DocumentType\Index;
namespace Valantic\ElasticaBridgeBundle\Document;

use Valantic\ElasticaBridgeBundle\Exception\Index\TenantNotSetException;

Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/Pimcore/AbstractListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Pimcore\Model\DataObject\AbstractObject;
use Pimcore\Model\Element\AbstractElement;
use Valantic\ElasticaBridgeBundle\DocumentType\Index\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Document\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Elastica\Client\ElasticsearchClient;
use Valantic\ElasticaBridgeBundle\Exception\EventListener\PimcoreElementNotFoundException;
use Valantic\ElasticaBridgeBundle\Index\IndexInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Index/AbstractIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Elastica\Document;
use Elastica\Index;
use Pimcore\Model\Element\AbstractElement;
use Valantic\ElasticaBridgeBundle\DocumentType\Index\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Document\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Elastica\Client\ElasticsearchClient;
use Valantic\ElasticaBridgeBundle\Enum\DocumentType;
use Valantic\ElasticaBridgeBundle\Enum\IndexBlueGreenSuffix;
Expand Down
4 changes: 2 additions & 2 deletions src/Index/IndexInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use Elastica\Query;
use Pimcore\Model\Element\AbstractElement;
use Valantic\ElasticaBridgeBundle\Command\Index as IndexCommand;
use Valantic\ElasticaBridgeBundle\DocumentType\Index\DocumentNormalizerTrait;
use Valantic\ElasticaBridgeBundle\DocumentType\Index\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Document\DocumentNormalizerTrait;
use Valantic\ElasticaBridgeBundle\Document\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Enum\IndexBlueGreenSuffix;
use Valantic\ElasticaBridgeBundle\Exception\Index\BlueGreenIndicesIncorrectlySetupException;

Expand Down
2 changes: 1 addition & 1 deletion src/Repository/DocumentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Valantic\ElasticaBridgeBundle\Repository;

use Valantic\ElasticaBridgeBundle\DocumentType\Index\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Document\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Service\BridgeHelper;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Service/DocumentHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use Elastica\Document;
use Pimcore\Model\Element\AbstractElement;
use Valantic\ElasticaBridgeBundle\DocumentType\Index\DocumentInterface;
use Valantic\ElasticaBridgeBundle\DocumentType\Index\TenantAwareInterface as DocumentTenantAwareInterface;
use Valantic\ElasticaBridgeBundle\Document\DocumentInterface;
use Valantic\ElasticaBridgeBundle\Document\TenantAwareInterface as DocumentTenantAwareInterface;
use Valantic\ElasticaBridgeBundle\Index\IndexInterface;
use Valantic\ElasticaBridgeBundle\Index\TenantAwareInterface as IndexTenantAwareInterfaceAlias;

Expand Down

0 comments on commit bae361b

Please sign in to comment.