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 Symfony package. * * (c) Fabien Potencier <fabien@..

Decoded Output download

<?php

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

namespace Symfony\Component\Messenger\Transport\Receiver;

use Symfony\Component\Messenger\Envelope;

/**
 * Receiver that decorates another, but receives only 1 specific message.
 *
 * @author Ryan Weaver <[email protected]>
 *
 * @internal
 */
class SingleMessageReceiver implements ReceiverInterface
{
    private bool $hasReceived = false;

    public function __construct(
        private ReceiverInterface $receiver,
        private Envelope $envelope,
    ) {
    }

    public function get(): iterable
    {
        if ($this->hasReceived) {
            return [];
        }

        $this->hasReceived = true;

        return [$this->envelope];
    }

    public function ack(Envelope $envelope): void
    {
        $this->receiver->ack($envelope);
    }

    public function reject(Envelope $envelope): void
    {
        $this->receiver->reject($envelope);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

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

namespace Symfony\Component\Messenger\Transport\Receiver;

use Symfony\Component\Messenger\Envelope;

/**
 * Receiver that decorates another, but receives only 1 specific message.
 *
 * @author Ryan Weaver <[email protected]>
 *
 * @internal
 */
class SingleMessageReceiver implements ReceiverInterface
{
    private bool $hasReceived = false;

    public function __construct(
        private ReceiverInterface $receiver,
        private Envelope $envelope,
    ) {
    }

    public function get(): iterable
    {
        if ($this->hasReceived) {
            return [];
        }

        $this->hasReceived = true;

        return [$this->envelope];
    }

    public function ack(Envelope $envelope): void
    {
        $this->receiver->ack($envelope);
    }

    public function reject(Envelope $envelope): void
    {
        $this->receiver->reject($envelope);
    }
}

Function Calls

None

Variables

None

Stats

MD5 410ec136da8c4ead2022ed0ed07a0d1a
Eval Count 0
Decode Time 103 ms