--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/b971ac31-7475-4c59-8256-14d370648abd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
As an said, catch should be usable as a method name in PHP7: http://php.net/manual/en/migration70.other-changes.php
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/ecb163e6-0e6a-4c96-8795-c5b9533505e2%40googlegroups.com.
Promises can't handle collections of async values.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/bbd96e38-e325-4fac-80f8-d96108b6808c%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/cde72023-9b48-46f0-9122-169ed73d88a0%40googlegroups.com.
Or a single interface including both static and normal methods:
interface Promise {
public function done(callable $fn) : Promise;
public function fail(callable $fn) : Promise;
public function always(callable $fn) : Promise;
public static when(Promise[] $promises) : Promise;
}
done() registers a callback to be called when the promise succeeds,
fail() does the same, but for when it fails. always() registers it to be
always called after done/fail callbacks.
when() takes an array of promises and done()s when all of them done(),
and fail()s when even a single one of them fail()s, and the callbacks
receive every promise result as parameters, in order (or an array of
them, you you want "strict typing").
What I don't like of the A+ promises is that you must provide a success
callback, even if you just need a fail handler:
$filePromise = PFile::open($fileName, 'w');
$filePromise.then(function($file) { ... write to file... });
$filePromise.then(function($file) { //do nothing }, function($err) { ...
log error ... });
With done/fail it's much clearer:
$filePromise = PFile::open($fileName, 'w');
$filePromise.done(function($file) { ... write to file... });
$filePromise.fail(function($err) { ... log error ... });
Bye.
But I am making this an A vs a B thing! :-) There is nothing a Promise can do that an Observable can't.
I think that there is a growing consensus in the JS community that Observables are better than Promises.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/a4a879ba-b068-470d-8646-679a111b1c70%40googlegroups.com.