Skip to content

Commit

Permalink
Merge pull request #5 from othillo/broadway-1.0
Browse files Browse the repository at this point in the history
use broadway/broadway 1.0
  • Loading branch information
asm89 authored Mar 6, 2017
2 parents ad6f116 + c70d5b8 commit 0eccae3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"require": {
"php": ">=5.5.9",
"broadway/broadway": "^1.0@dev",
"broadway/broadway": "^1.0",
"elasticsearch/elasticsearch": "^2.0"
},
"authors": [
Expand Down
12 changes: 6 additions & 6 deletions src/ElasticSearchRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
namespace Broadway\ReadModel\ElasticSearch;

use Assert\Assertion;
use Broadway\ReadModel\ReadModelInterface;
use Broadway\ReadModel\RepositoryInterface;
use Broadway\Serializer\SerializerInterface;
use Broadway\ReadModel\Identifiable;
use Broadway\ReadModel\Repository;
use Broadway\Serializer\Serializer;
use Elasticsearch\Client;
use Elasticsearch\Common\Exceptions\Missing404Exception;

/**
* Repository implementation using Elasticsearch as storage.
*/
class ElasticSearchRepository implements RepositoryInterface
class ElasticSearchRepository implements Repository
{
private $client;
private $serializer;
Expand All @@ -36,7 +36,7 @@ class ElasticSearchRepository implements RepositoryInterface
*/
public function __construct(
Client $client,
SerializerInterface $serializer,
Serializer $serializer,
$index,
$class,
array $notAnalyzedFields = []
Expand All @@ -51,7 +51,7 @@ public function __construct(
/**
* {@inheritDoc}
*/
public function save(ReadModelInterface $data)
public function save(Identifiable $data)
{
Assertion::isInstanceOf($data, $this->class);

Expand Down
8 changes: 4 additions & 4 deletions src/ElasticSearchRepositoryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@

namespace Broadway\ReadModel\ElasticSearch;

use Broadway\ReadModel\RepositoryFactoryInterface;
use Broadway\Serializer\SerializerInterface;
use Broadway\ReadModel\RepositoryFactory;
use Broadway\Serializer\Serializer;
use Elasticsearch\Client;

/**
* Creates Elasticsearch repositories.
*/
class ElasticSearchRepositoryFactory implements RepositoryFactoryInterface
class ElasticSearchRepositoryFactory implements RepositoryFactory
{
private $client;
private $serializer;

public function __construct(Client $client, SerializerInterface $serializer)
public function __construct(Client $client, Serializer $serializer)
{
$this->client = $client;
$this->serializer = $serializer;
Expand Down
4 changes: 2 additions & 2 deletions test/ElasticSearchRepositoryFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ElasticSearchRepositoryFactoryTest extends PHPUnit_Framework_TestCase
*/
public function it_creates_an_elastic_search_repository()
{
$serializer = $this->getMock('Broadway\Serializer\SerializerInterface');
$serializer = $this->getMock('Broadway\Serializer\Serializer');
$client = $this->getMockBuilder('\Elasticsearch\Client')
->disableOriginalConstructor()
->getMock();
Expand All @@ -36,7 +36,7 @@ public function it_creates_an_elastic_search_repository()
*/
public function it_creates_an_elastic_search_repository_containing_index_metadata()
{
$serializer = $this->getMock('Broadway\Serializer\SerializerInterface');
$serializer = $this->getMock('Broadway\Serializer\Serializer');
$client = $this->getMockBuilder('\Elasticsearch\Client')
->disableOriginalConstructor()
->getMock();
Expand Down
6 changes: 3 additions & 3 deletions test/ElasticSearchRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Broadway\ReadModel\ElasticSearch;

use Broadway\ReadModel\RepositoryTestCase;
use Broadway\Serializer\SerializerInterface;
use Broadway\Serializer\Serializer;
use Broadway\Serializer\SimpleInterfaceSerializer;
use Elasticsearch\Client;

Expand All @@ -38,7 +38,7 @@ protected function createRepository()
);
}

protected function createElasticSearchRepository(Client $client, SerializerInterface $serializer, $index, $class)
protected function createElasticSearchRepository(Client $client, Serializer $serializer, $index, $class)
{
return new ElasticSearchRepository($client, $serializer, $index, $class);
}
Expand Down Expand Up @@ -80,7 +80,7 @@ public function it_creates_an_index_with_non_analyzed_terms()
*/
public function it_throws_when_saving_a_readmodel_of_other_type_than_configured()
{
$readModel = $this->prophesize('\Broadway\ReadModel\ReadModelInterface');
$readModel = $this->prophesize('\Broadway\ReadModel\Identifiable');

$this->repository->save($readModel->reveal());
}
Expand Down

0 comments on commit 0eccae3

Please sign in to comment.