reactphp/promise — pull request #12 by jsor (2013-10-22 19:40:05+00:00)
Title: 2.0

The goal is to streamline the API and to make it more compliant with other promise libraries and especially with the new upcoming [ES6 promises specification](https://github.com/domenic/promises-unwrapping/).

* **Add standalone Promise class.**
Provides an alternative promise-creation API that has the same power as the deferred concept, but without introducing another conceptual entity plus it's identical with [Promise object](https://github.com/domenic/promises-unwrapping#promise--resolver-) from the upconing ES6 promises specification.

* **BC break: Bump minimum PHP version to PHP 5.4.**
Allows the callable typehint (see a4d6358a26579a4c2b1840bff0ffa5bb8bbe1134, removes the hacky error triggering from a0f23cb45c1f8d629f795acf5ae5aafc0c9d4260). `$this` can be used in anonymous functions ([example](https://github.com/reactphp/promise/commit/46048ecca6ea5e8b4adcad2f185bbf208dcdb724#diff-f6ec0ec6909a12e4247b9281cc0d5847R15)).

* **BC break: Remove ResolverInterface and PromiseInterface from Deferred.**
Usage of `Deferred::then` has been always discouraged and it only existed because it was used by the (now removed) `DeferredPromise` class. Removed the `ResolverInterface` entirely for the sake of simplicity. I haven't come across any single userland usage.

* **BC break: Change signature of PromiseInterface.**
Added the callable typehint and renamed arguments to be compliant with the [ES6 promises specification](https://github.com/domenic/promises-unwrapping#promiseprototypethen--onfulfilled--onrejected-) and [Promise/A+](https://github.com/promises-aplus/promises-spec#the-then-method) naming conventions.

* **BC break: Remove When and Util classes and move static methods to functions.**
FFTW (Functions For The Win)

* **BC break: FulfilledPromise and RejectedPromise now throw an exception when initialized with a promise instead of a value/reason.**
This is more a bugfix than a BC break. Since FulfilledPromise and RejectedPromise are now documented in the API docs, i fixed it. In 1.0, we only documented `When::resolve()` and `When::reject()` as public API which only creates instances if value/reason was not a promise.