From 25d01b7ac9a025a0d5721e7fa6079638a2b7fc14 Mon Sep 17 00:00:00 2001 From: Sander van Thillo Date: Mon, 27 Feb 2017 08:33:16 +0100 Subject: [PATCH 1/2] use broadway/broadway 1.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fa84347..a1704ca 100644 --- a/composer.json +++ b/composer.json @@ -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": [ From c70d5b88c260b521735786b7bb0a7d6e52055d9f Mon Sep 17 00:00:00 2001 From: Sander van Thillo Date: Mon, 6 Mar 2017 12:52:19 +0100 Subject: [PATCH 2/2] used renamed interfaces --- src/ElasticSearchRepository.php | 12 ++++++------ src/ElasticSearchRepositoryFactory.php | 8 ++++---- test/ElasticSearchRepositoryFactoryTest.php | 4 ++-- test/ElasticSearchRepositoryTest.php | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/ElasticSearchRepository.php b/src/ElasticSearchRepository.php index 24761f2..8c3086a 100644 --- a/src/ElasticSearchRepository.php +++ b/src/ElasticSearchRepository.php @@ -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; @@ -36,7 +36,7 @@ class ElasticSearchRepository implements RepositoryInterface */ public function __construct( Client $client, - SerializerInterface $serializer, + Serializer $serializer, $index, $class, array $notAnalyzedFields = [] @@ -51,7 +51,7 @@ public function __construct( /** * {@inheritDoc} */ - public function save(ReadModelInterface $data) + public function save(Identifiable $data) { Assertion::isInstanceOf($data, $this->class); diff --git a/src/ElasticSearchRepositoryFactory.php b/src/ElasticSearchRepositoryFactory.php index 3aa4e89..f7d6774 100644 --- a/src/ElasticSearchRepositoryFactory.php +++ b/src/ElasticSearchRepositoryFactory.php @@ -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; diff --git a/test/ElasticSearchRepositoryFactoryTest.php b/test/ElasticSearchRepositoryFactoryTest.php index 2e9866d..1bf117c 100644 --- a/test/ElasticSearchRepositoryFactoryTest.php +++ b/test/ElasticSearchRepositoryFactoryTest.php @@ -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(); @@ -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(); diff --git a/test/ElasticSearchRepositoryTest.php b/test/ElasticSearchRepositoryTest.php index 8f1ac61..fbd146e 100644 --- a/test/ElasticSearchRepositoryTest.php +++ b/test/ElasticSearchRepositoryTest.php @@ -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; @@ -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); } @@ -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()); }