Skip to content

Commit cdd405e

Browse files
committed
cleanup
1 parent f58ab38 commit cdd405e

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ All notable changes to `laravel-elastica-bridge` will be documented in this file
44

55
## 1.1.0 - UNRELEASED
66

7-
- provide default implementation for `Limenet\LaravelElasticaBridge\Model\ElasticsearchableInterface\toElasticsearch`
7+
- provide default implementation for `Limenet\LaravelElasticaBridge\Model\ElasticsearchableInterface::toElasticsearch()` in `ElasticsearchableTrait`
8+
- provide default implementation for `Limenet\LaravelElasticaBridge\Model\ElasticsearchableInterface::shouldIndex()` in `ElasticsearchableTrait`
9+
- remove unused method `Limenet\LaravelElasticaBridge\Model\ElasticsearchableInterface::getModel()`
810
- added tests
911

1012
## 1.0.0 - 2021-05-09

src/Model/ElasticsearchableInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
interface ElasticsearchableInterface
1111
{
12-
public function getModel(): string;
13-
1412
/**
1513
* @internal
1614
*/

src/Model/ElasticsearchableTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99

1010
trait ElasticsearchableTrait
1111
{
12-
final public function getModel(): string
13-
{
14-
return __CLASS__;
15-
}
16-
1712
final public function getElasticsearchId(): string
1813
{
1914
return $this::class.'|'.$this->id;
@@ -23,6 +18,11 @@ public function toElasticsearch(IndexInterface $indexConfig): array
2318
return $this->toArray();
2419
}
2520

21+
public function shouldIndex(IndexInterface $indexConfig): bool
22+
{
23+
return true;
24+
}
25+
2626
public function toElasticaDocument(IndexInterface $indexConfig): Document
2727
{
2828
return new Document(

tests/App/Models/Product.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ class Product extends Model implements ElasticsearchableInterface
1515
use HasFactory;
1616
use ElasticsearchableTrait;
1717

18-
public function shouldIndex(IndexInterface $indexConfig): bool
19-
{
20-
return true;
21-
}
22-
2318
protected static function newFactory(): Factory
2419
{
2520
return ProductFactory::new();

0 commit comments

Comments
 (0)