Rx\Observable::doOnEach PHP Method

doOnEach() public method

This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. When using doOnEach, it is important to note that the Observer may receive additional events after a stream has completed or errored (such as when useing a repeat or resubscribing). If you are using an Observable that extends the AbstractObservable, you will not receive these events. For this special case, use the DoObserver. doOnNext, doOnError, and doOnCompleted uses the DoObserver internally and will receive these additional events.
public doOnEach ( rx\ObserverInterface $observer ) : Rx\Observable\AnonymousObservable
$observer rx\ObserverInterface
return Rx\Observable\AnonymousObservable
    public function doOnEach(ObserverInterface $observer)
    {
        return $this->lift(function () use($observer) {
            return new DoOnEachOperator($observer);
        });
    }