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); /** * Passbolt ~ Open source password manager for teams ..

Decoded Output download

<?php
declare(strict_types=1);

/**
 * Passbolt ~ Open source password manager for teams
 * Copyright (c) Passbolt SA (https://www.passbolt.com)
 *
 * Licensed under GNU Affero General Public License version 3 of the or any later version.
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Passbolt SA (https://www.passbolt.com)
 * @license       https://opensource.org/licenses/AGPL-3.0 AGPL License
 * @link          https://www.passbolt.com Passbolt(tm)
 * @since         2.12.0
 */
namespace App\Notification\Email;

use Cake\Event\Event;

/**
 * Class EmailSubscriptionManager
 *
 * @package App\Notification\Email
 *
 * The EmailSubscriptionManager class is a composite object to handle the email subscriptions.
 * It handles the list of the subscription from creation to retrieval.
 * It is provided by the EmailSubscriptionDispatcher to the SubscribedEmailRedactor, and used
 * by the latter to make the registration.
 */
class EmailSubscriptionManager
{
    /**
     * @var array
     */
    private array $subscriptions = [];

    /**
     * @param \App\Notification\Email\SubscribedEmailRedactorInterface $subscribedEmailRedactor Email Redactor
     * @return $this
     */
    public function addNewSubscription(SubscribedEmailRedactorInterface $subscribedEmailRedactor)
    {
        foreach ($subscribedEmailRedactor->getSubscribedEvents() as $subscribedEvent) {
            $this->subscriptions[$subscribedEvent][] = $subscribedEmailRedactor;
        }

        return $this;
    }

    /**
     * @param \Cake\Event\Event $event Event object
     * @return \App\Notification\Email\SubscribedEmailRedactorInterface[]
     */
    public function getSubscriptionsForEvent(Event $event): array
    {
        return $this->subscriptions[$event->getName()] ?? [];
    }

    /**
     * @return array
     */
    public function getSubscribedEvents(): array
    {
        return array_keys($this->subscriptions);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php
declare(strict_types=1);

/**
 * Passbolt ~ Open source password manager for teams
 * Copyright (c) Passbolt SA (https://www.passbolt.com)
 *
 * Licensed under GNU Affero General Public License version 3 of the or any later version.
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Passbolt SA (https://www.passbolt.com)
 * @license       https://opensource.org/licenses/AGPL-3.0 AGPL License
 * @link          https://www.passbolt.com Passbolt(tm)
 * @since         2.12.0
 */
namespace App\Notification\Email;

use Cake\Event\Event;

/**
 * Class EmailSubscriptionManager
 *
 * @package App\Notification\Email
 *
 * The EmailSubscriptionManager class is a composite object to handle the email subscriptions.
 * It handles the list of the subscription from creation to retrieval.
 * It is provided by the EmailSubscriptionDispatcher to the SubscribedEmailRedactor, and used
 * by the latter to make the registration.
 */
class EmailSubscriptionManager
{
    /**
     * @var array
     */
    private array $subscriptions = [];

    /**
     * @param \App\Notification\Email\SubscribedEmailRedactorInterface $subscribedEmailRedactor Email Redactor
     * @return $this
     */
    public function addNewSubscription(SubscribedEmailRedactorInterface $subscribedEmailRedactor)
    {
        foreach ($subscribedEmailRedactor->getSubscribedEvents() as $subscribedEvent) {
            $this->subscriptions[$subscribedEvent][] = $subscribedEmailRedactor;
        }

        return $this;
    }

    /**
     * @param \Cake\Event\Event $event Event object
     * @return \App\Notification\Email\SubscribedEmailRedactorInterface[]
     */
    public function getSubscriptionsForEvent(Event $event): array
    {
        return $this->subscriptions[$event->getName()] ?? [];
    }

    /**
     * @return array
     */
    public function getSubscribedEvents(): array
    {
        return array_keys($this->subscriptions);
    }
}

Function Calls

None

Variables

None

Stats

MD5 a56f3f921a409a0a16fb5495a56acf49
Eval Count 0
Decode Time 81 ms