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\AsyncLoopMiddleware;
use Reli\Lib\Log\Log;
use Reli\Lib\Loop\AsyncLoopMiddlewareInterface;
class ExitLoopOnSpecificExceptionMiddlewareAsync implements AsyncLoopMiddlewareInterface
{
/** @param array<class-string<\Throwable>> $exception_names */
public function __construct(
private array $exception_names,
private AsyncLoopMiddlewareInterface $chain
) {
}
public function invoke(): \Generator
{
try {
yield from $this->chain->invoke();
} catch (\Throwable $e) {
foreach ($this->exception_names as $exception_name) {
/** @psalm-suppress DocblockTypeContradiction */
if (is_a($e, $exception_name)) {
Log::debug(
$e->getMessage(),
[
'trace' => $e->getTrace()
]
);
return;
}
}
throw $e;
}
}
}
?>
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\AsyncLoopMiddleware;
use Reli\Lib\Log\Log;
use Reli\Lib\Loop\AsyncLoopMiddlewareInterface;
class ExitLoopOnSpecificExceptionMiddlewareAsync implements AsyncLoopMiddlewareInterface
{
/** @param array<class-string<\Throwable>> $exception_names */
public function __construct(
private array $exception_names,
private AsyncLoopMiddlewareInterface $chain
) {
}
public function invoke(): \Generator
{
try {
yield from $this->chain->invoke();
} catch (\Throwable $e) {
foreach ($this->exception_names as $exception_name) {
/** @psalm-suppress DocblockTypeContradiction */
if (is_a($e, $exception_name)) {
Log::debug(
$e->getMessage(),
[
'trace' => $e->getTrace()
]
);
return;
}
}
throw $e;
}
}
}
Function Calls
None |
Stats
MD5 | 74c8ada374ae6a6f626e1c6545fc5d40 |
Eval Count | 0 |
Decode Time | 88 ms |