Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Rx\Observer; use Exception; use Rx\Disposable\EmptyDisposable; use Rx\Ob..

Decoded Output download

<?php

namespace Rx\Observer;

use Exception;
use Rx\Disposable\EmptyDisposable;
use Rx\ObserverInterface;
use Rx\DisposableInterface;
use Rx\Disposable\SingleAssignmentDisposable;

class AutoDetachObserver extends AbstractObserver
{
    private $observer;

    public function __construct(ObserverInterface $observer)
    {
        $this->observer   = $observer;
        $this->disposable = new SingleAssignmentDisposable();
    }

    public function setDisposable(DisposableInterface $disposable = null)
    {
        $disposable = $disposable ?: new EmptyDisposable();

        $this->disposable->setDisposable($disposable);
    }

    protected function completed()
    {
        try {
            $this->observer->onCompleted();
        } catch (Exception $e) {
            throw $e;
        } finally {
            $this->dispose();
        }
    }

    protected function error(Exception $exception)
    {
        try {
            $this->observer->onError($exception);
        } catch (Exception $e) {
            throw $e;
        } finally {
            $this->dispose();
        }
    }

    protected function next($value)
    {
        try {
            $this->observer->onNext($value);
        } catch (Exception $e) {
            $this->dispose();
            throw $e;
        }
    }

    public function dispose()
    {
        $this->disposable->dispose();
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Rx\Observer;

use Exception;
use Rx\Disposable\EmptyDisposable;
use Rx\ObserverInterface;
use Rx\DisposableInterface;
use Rx\Disposable\SingleAssignmentDisposable;

class AutoDetachObserver extends AbstractObserver
{
    private $observer;

    public function __construct(ObserverInterface $observer)
    {
        $this->observer   = $observer;
        $this->disposable = new SingleAssignmentDisposable();
    }

    public function setDisposable(DisposableInterface $disposable = null)
    {
        $disposable = $disposable ?: new EmptyDisposable();

        $this->disposable->setDisposable($disposable);
    }

    protected function completed()
    {
        try {
            $this->observer->onCompleted();
        } catch (Exception $e) {
            throw $e;
        } finally {
            $this->dispose();
        }
    }

    protected function error(Exception $exception)
    {
        try {
            $this->observer->onError($exception);
        } catch (Exception $e) {
            throw $e;
        } finally {
            $this->dispose();
        }
    }

    protected function next($value)
    {
        try {
            $this->observer->onNext($value);
        } catch (Exception $e) {
            $this->dispose();
            throw $e;
        }
    }

    public function dispose()
    {
        $this->disposable->dispose();
    }
}

Function Calls

None

Variables

None

Stats

MD5 c5c267394a8093bd1bf7364d0139d5ae
Eval Count 0
Decode Time 94 ms