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\Functional\Scheduler; use React\EventLoop\Factory; use Rx\Functional\..

Decoded Output download

<?php

namespace Rx\Functional\Scheduler;

use React\EventLoop\Factory;
use Rx\Functional\FunctionalTestCase;
use Rx\Observable;
use Rx\Observer\CallbackObserver;
use Rx\Scheduler\EventLoopScheduler;

class EventLoopSchedulerTest extends FunctionalTestCase
{
    public function testDisposeInsideFirstSchedulePeriodicAction()
    {
        $loop = Factory::create();

        $scheduler = new EventLoopScheduler($loop);

        $completed = false;
        $nextCount = 0;

        Observable::interval(50, $scheduler)
            ->take(1)
            ->subscribe(new CallbackObserver(
                function ($x) use (&$nextCount) {
                    $nextCount++;
                },
                function ($err) {
                    throw $err;
                },
                function () use (&$completed) {
                    $completed = true;
                }
            ));

        $loop->run();

        $this->assertTrue($completed);
        $this->assertEquals(1, $nextCount);
    }
} ?>

Did this file decode correctly?

Original Code

<?php

namespace Rx\Functional\Scheduler;

use React\EventLoop\Factory;
use Rx\Functional\FunctionalTestCase;
use Rx\Observable;
use Rx\Observer\CallbackObserver;
use Rx\Scheduler\EventLoopScheduler;

class EventLoopSchedulerTest extends FunctionalTestCase
{
    public function testDisposeInsideFirstSchedulePeriodicAction()
    {
        $loop = Factory::create();

        $scheduler = new EventLoopScheduler($loop);

        $completed = false;
        $nextCount = 0;

        Observable::interval(50, $scheduler)
            ->take(1)
            ->subscribe(new CallbackObserver(
                function ($x) use (&$nextCount) {
                    $nextCount++;
                },
                function ($err) {
                    throw $err;
                },
                function () use (&$completed) {
                    $completed = true;
                }
            ));

        $loop->run();

        $this->assertTrue($completed);
        $this->assertEquals(1, $nextCount);
    }
}

Function Calls

None

Variables

None

Stats

MD5 297f1e8e7a8a7a9bde95fe3b089fbc81
Eval Count 0
Decode Time 101 ms