Skip to content

Commit

Permalink
Backport API changes to 5.5+ compat
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlowrey committed May 4, 2015
1 parent b9819d8 commit cddb8e9
Show file tree
Hide file tree
Showing 16 changed files with 801 additions and 316 deletions.
7 changes: 1 addition & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
],
"require": {
"php": ">=7.0.0-dev"
"php": "^5.5"
},
"require-dev": {
"phpunit/phpunit": "~4.4.0"
Expand All @@ -36,11 +36,6 @@
"Amp\\Test\\": "test/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"suggest": {
"php-uv": "Extension for libuv backends (high performance use cases)."
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Future.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Future implements Promisor, Promise {
*
* @return \Amp\Promise
*/
public function promise(): Promise {
public function promise() {
return $this;
}

Expand Down Expand Up @@ -46,15 +46,15 @@ public function watch(callable $func) {
* {@inheritDoc}
* @throws \LogicException if the promise has already resolved
*/
public function update(...$progress) {
public function update($progress) {
if ($this->isResolved) {
throw new \LogicException(
'Cannot update resolved promise'
);
}

foreach ($this->watchers as $watcher) {
$watcher(...$progress);
$watcher($progress);
}
}

Expand Down

0 comments on commit cddb8e9

Please sign in to comment.