diff --git a/composer.json b/composer.json index d3a2b7f..d96a806 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "license": "MIT", "require": { "php": ">=7.2", - "broadway/broadway-saga": "~0.8", + "broadway/broadway-saga": "~0.10", "doctrine/mongodb": "^1.0", "beberlei/assert": "^3.0", "alcaeus/mongo-php-adapter": "^1.1" diff --git a/src/MongoDBRepository.php b/src/MongoDBRepository.php index 9f97145..960dba1 100644 --- a/src/MongoDBRepository.php +++ b/src/MongoDBRepository.php @@ -31,7 +31,7 @@ public function __construct(Collection $collection) /** * {@inheritdoc} */ - public function findOneBy(Criteria $criteria, $sagaId) + public function findOneBy(Criteria $criteria, $sagaId): ?State { $query = $this->createQuery($criteria, $sagaId); $results = $query->execute(); @@ -51,7 +51,7 @@ public function findOneBy(Criteria $criteria, $sagaId) /** * {@inheritdoc} */ - public function save(State $state, $sagaId) + public function save(State $state, $sagaId): void { $serializedState = $state->serialize(); $serializedState['_id'] = $serializedState['id']; diff --git a/test/MongoDBRepositoryTest.php b/test/MongoDBRepositoryTest.php index e3dadb6..3697b6f 100644 --- a/test/MongoDBRepositoryTest.php +++ b/test/MongoDBRepositoryTest.php @@ -13,6 +13,7 @@ namespace Broadway\Saga\State\MongoDB; +use Broadway\Saga\State\RepositoryInterface; use Broadway\Saga\State\Testing\AbstractRepositoryTest; use Doctrine\MongoDB\Configuration; use Doctrine\MongoDB\Connection; @@ -22,7 +23,7 @@ class MongoDBRepositoryTest extends AbstractRepositoryTest protected static $dbName = 'doctrine_mongodb'; protected $connection; - protected function createRepository() + protected function createRepository(): RepositoryInterface { $config = new Configuration(); $config->setLoggerCallable(function ($msg) {});