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 declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien..

Decoded Output download

<?php

declare(strict_types=1);

/*
 * This file is part of PHP CS Fixer.
 *
 * (c) Fabien Potencier <[email protected]>
 *     Dariusz Rumiski <[email protected]>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace PhpCsFixer\Tests\Runner\Parallel;

use PhpCsFixer\Runner\Parallel\WorkerException;
use PhpCsFixer\Tests\TestCase;

/**
 * @covers \PhpCsFixer\Runner\Parallel\WorkerException
 *
 * @internal
 */
final class WorkerExceptionTest extends TestCase
{
    public function testFromRaw(): void
    {
        $exception = WorkerException::fromRaw([
            'class' => \RuntimeException::class,
            'message' => 'foo',
            'file' => 'foo.php',
            'line' => 1,
            'code' => 1,
            'trace' => '#0 bar',
        ]);

        self::assertSame('[RuntimeException] foo', $exception->getMessage());
        self::assertSame('foo.php', $exception->getFile());
        self::assertSame(1, $exception->getLine());
        self::assertSame(1, $exception->getCode());
        self::assertSame('## foo.php(1)'.PHP_EOL.'#0 bar', $exception->getOriginalTraceAsString());
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

/*
 * This file is part of PHP CS Fixer.
 *
 * (c) Fabien Potencier <[email protected]>
 *     Dariusz Rumiski <[email protected]>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace PhpCsFixer\Tests\Runner\Parallel;

use PhpCsFixer\Runner\Parallel\WorkerException;
use PhpCsFixer\Tests\TestCase;

/**
 * @covers \PhpCsFixer\Runner\Parallel\WorkerException
 *
 * @internal
 */
final class WorkerExceptionTest extends TestCase
{
    public function testFromRaw(): void
    {
        $exception = WorkerException::fromRaw([
            'class' => \RuntimeException::class,
            'message' => 'foo',
            'file' => 'foo.php',
            'line' => 1,
            'code' => 1,
            'trace' => '#0 bar',
        ]);

        self::assertSame('[RuntimeException] foo', $exception->getMessage());
        self::assertSame('foo.php', $exception->getFile());
        self::assertSame(1, $exception->getLine());
        self::assertSame(1, $exception->getCode());
        self::assertSame('## foo.php(1)'.PHP_EOL.'#0 bar', $exception->getOriginalTraceAsString());
    }
}

Function Calls

None

Variables

None

Stats

MD5 a6a29ecd664382fe77f379308d456929
Eval Count 0
Decode Time 98 ms