Skip to content

Commit

Permalink
Broadway 2.0, PHP 7 (#12)
Browse files Browse the repository at this point in the history
* require Broadway 2.0

* test against PHP 7

* composer already ipdated by Travis CI

* removed obsolete option

* install polyfill for ext-mongo

* changelog

* added return type hints

* set branch alias to 1.0
  • Loading branch information
othillo authored Dec 10, 2017
1 parent 66f6ccd commit 2a876bf
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
16 changes: 6 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@ language: php

matrix:
include:
- php: 5.5
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
fast_finish: true

before_install:
# Disable XDebug speed up test execution.
- phpenv config-rm xdebug.ini || return 0
# Enable correct MongoDB driver for each PHP version
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." ]]; then echo "extension=mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini || return 0; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then echo "extension=mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini || return 0; fi
# Enable MongoDB extension
- echo "extension=mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini || return 0
- echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini || return 0

install:
- travis_retry composer self-update
# Install a polyfill for Mongo extension on PHP 7
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then travis_retry composer config "platform.ext-mongo" "1.6.16" && composer require alcaeus/mongo-php-adapter; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." ]]; then travis_retry composer update; fi
- composer info -i
- composer install
- composer info

script:
- vendor/bin/phpunit --exclude-group=none
- git log $(git describe --abbrev=0 --tags)...HEAD --no-merges --pretty=format:"* [%h](http://github.com/${TRAVIS_REPO_SLUG}/commit/%H) %s (%cN)"

branches:
only:
Expand Down
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"description": "Proof-of-concept component providing saga functionality to broadway/broadway.",
"license": "MIT",
"require": {
"php": ">=5.5.9",
"broadway/broadway": "^1.0",
"beberlei/assert": "^2.0"
"php": ">=7.0",
"broadway/broadway": "^2.0",
"beberlei/assert": "^2.0",
"alcaeus/mongo-php-adapter": "^1.1"
},
"authors": [
{
Expand Down Expand Up @@ -54,7 +55,12 @@
},
"extra": {
"branch-alias": {
"dev-master": "0.3.x-dev"
"dev-master": "1.0.x-dev"
}
},
"config": {
"platform": {
"ext-mongo": "1.6.16"
}
}
}
2 changes: 1 addition & 1 deletion src/SagaMetadataEnricher.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function postHandleSaga($type, $id)
$this->sagaData = ['type' => $type, 'state_id' => $id];
}

public function enrich(Metadata $metadata)
public function enrich(Metadata $metadata): Metadata
{
if (count($this->sagaData) === 0) {
return $metadata;
Expand Down
2 changes: 1 addition & 1 deletion src/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function isDone()
/**
* {@inheritDoc}
*/
public function serialize()
public function serialize(): array
{
return ['id' => $this->getId(), 'values' => $this->values, 'done' => $this->isDone()];
}
Expand Down

0 comments on commit 2a876bf

Please sign in to comment.