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 /** * This file is part of the reliforp/reli-prof package. * * (c) sji <sji@sj-i..

Decoded Output download

<?php

/**
 * This file is part of the reliforp/reli-prof package.
 *
 * (c) sji <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Reli\Lib\Loop;

use Reli\BaseTestCase;
use Reli\Lib\Loop\AsyncLoopMiddleware\CallableMiddlewareAsync;

class AsyncLoopBuilderTest extends BaseTestCase
{
    public function testBuild(): void
    {
        $builder = new AsyncLoopBuilder();
        $new_builder = $builder->addProcess(CallableMiddlewareAsync::class, [
            function () {
                yield 1;
                yield 2;
                yield 3;
            }
        ]);
        $loop = $new_builder->build();
        $result = $loop->invoke();
        $this->assertSame(1, $result->current());
        $result->next();
        $this->assertSame(2, $result->current());
        $result->next();
        $this->assertSame(3, $result->current());
        $result->next();
        $this->assertSame(1, $result->current());
        $result->next();
        $this->assertSame(2, $result->current());
        $result->next();
        $this->assertSame(3, $result->current());

        $this->assertNotSame($builder, $new_builder);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

/**
 * This file is part of the reliforp/reli-prof package.
 *
 * (c) sji <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Reli\Lib\Loop;

use Reli\BaseTestCase;
use Reli\Lib\Loop\AsyncLoopMiddleware\CallableMiddlewareAsync;

class AsyncLoopBuilderTest extends BaseTestCase
{
    public function testBuild(): void
    {
        $builder = new AsyncLoopBuilder();
        $new_builder = $builder->addProcess(CallableMiddlewareAsync::class, [
            function () {
                yield 1;
                yield 2;
                yield 3;
            }
        ]);
        $loop = $new_builder->build();
        $result = $loop->invoke();
        $this->assertSame(1, $result->current());
        $result->next();
        $this->assertSame(2, $result->current());
        $result->next();
        $this->assertSame(3, $result->current());
        $result->next();
        $this->assertSame(1, $result->current());
        $result->next();
        $this->assertSame(2, $result->current());
        $result->next();
        $this->assertSame(3, $result->current());

        $this->assertNotSame($builder, $new_builder);
    }
}

Function Calls

None

Variables

None

Stats

MD5 9100dd73eff69e2b8d1cacdc4184e132
Eval Count 0
Decode Time 3985 ms