Skip to content

Commit

Permalink
add support for php above 7.0, update dependencies, remove becklyn/in…
Browse files Browse the repository at this point in the history
…terfaces
  • Loading branch information
Thyrannoizer committed Jan 12, 2023
1 parent 09931fc commit 8ed91a7
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Command/SearchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Becklyn\SearchBundle\Command;

use Becklyn\Interfaces\LanguageInterface;
use Becklyn\SearchBundle\Entity\LanguageInterface;
use Becklyn\SearchBundle\Search\Result\EntitySearchHits;
use Becklyn\SearchBundle\Search\Result\SearchHit;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
Expand Down
2 changes: 1 addition & 1 deletion Elasticsearch/Request/SearchRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Becklyn\SearchBundle\Elasticsearch\Request;

use Becklyn\Interfaces\LanguageInterface;
use Becklyn\SearchBundle\Elasticsearch\ElasticsearchClient;
use Becklyn\SearchBundle\Elasticsearch\ElasticsearchRequest;
use Becklyn\SearchBundle\Entity\LanguageInterface;
use Becklyn\SearchBundle\Metadata\SearchItem;


Expand Down
25 changes: 25 additions & 0 deletions Entity/LanguageInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Becklyn\SearchBundle\Entity;

/**
* A common interface for defining a language
*/
interface LanguageInterface
{
/**
* Returns the name of the language
*
* @return string
*/
public function getName () : string;



/**
* Returns the ISO short code of the language
*
* @return string
*/
public function getCode () : string;
}
2 changes: 0 additions & 2 deletions Entity/LocalizedSearchableEntityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Becklyn\SearchBundle\Entity;

use Becklyn\Interfaces\LanguageInterface;


/**
* Describes searchable entities, that are localized
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ class SomeEntity implements SearchableEntityInterface
For localized entities, mark the class and implement the `LocalizedSearchableEntityInterface` interface:

```php
use Becklyn\Interfaces\LanguageInterface;
use Becklyn\SearchBundle\Entity\LocalizedSearchableEntityInterface;
use Becklyn\SearchBundle\Mapping as Search;
use Becklyn\SearchBundle\Entity\LanguageInterface;use Becklyn\SearchBundle\Entity\LocalizedSearchableEntityInterface;use Becklyn\SearchBundle\Mapping as Search;
/**
* @Search\Item(
Expand All @@ -61,8 +59,6 @@ class LocalizedSomeEntity implements LocalizedSearchableEntityInterface
}
```

Note: you will need the `LanguageInterface` from the [`becklyn/interfaces`](https://github.com/Becklyn/Interfaces) package.

#### `@Search\Item()` annotation

```php
Expand Down
2 changes: 0 additions & 2 deletions Search/Result/EntitySearchHits.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Becklyn\SearchBundle\Search\Result;

use Becklyn\Interfaces\LanguageInterface;


/**
* A list of all search hits for a specific entity
Expand Down
3 changes: 1 addition & 2 deletions Search/SearchClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

namespace Becklyn\SearchBundle\Search;

use Becklyn\Interfaces\LanguageInterface;
use Becklyn\SearchBundle\Elasticsearch\ElasticsearchClient;
use Becklyn\SearchBundle\Elasticsearch\Request\SearchRequest;
use Becklyn\SearchBundle\Entity\LanguageInterface;
use Becklyn\SearchBundle\Exception\MissingLanguageException;
use Becklyn\SearchBundle\Index\Configuration\LanguageConfiguration;
use Becklyn\SearchBundle\Loader\EntityLoader;
use Becklyn\SearchBundle\Metadata\Metadata;
use Becklyn\SearchBundle\Metadata\MetadataFactory;
use Becklyn\SearchBundle\Metadata\SearchItem\SearchItemList;
use Becklyn\SearchBundle\Search\Result\SearchHit;
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
}
],
"require": {
"php": "^7.0",
"becklyn/interfaces": "^1.0",
"becklyn/search-text-transformer": "^1.0",
"doctrine/common": "^2.6",
"php": ">=7.0",
"becklyn/search-text-transformer": "^2.0",
"doctrine/common": "^2.6 || ^3.0",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"elasticsearch/elasticsearch": "^5.0",
"elasticsearch/elasticsearch": "^5.0 || ^8.5.0",
"symfony/cache": "^3.0 || ^4.0",
"symfony/console": "^3.0 || ^4.0",
"symfony/dependency-injection": "^3.0 || ^4.0",
Expand Down

0 comments on commit 8ed91a7

Please sign in to comment.