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 /** * Copyright Magento, Inc. All rights reserved. * See COPYING.txt for license ..

Decoded Output download

<?php
/**
 * Copyright  Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Analytics\Controller\Adminhtml\Reports;

use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
use Magento\Analytics\Model\Exception\State\SubscriptionUpdateException;
use Magento\Analytics\Model\ReportUrlProvider;
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\Result\Redirect;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Exception\LocalizedException;

/**
 * Provide redirect to resource with reports.
 */
class Show extends Action implements HttpGetActionInterface
{
    /**
     * @var ReportUrlProvider
     */
    private $reportUrlProvider;

    /**
     * @inheritdoc
     */
    const ADMIN_RESOURCE = 'Magento_Analytics::advanced_reporting';

    /**
     * @param Context $context
     * @param ReportUrlProvider $reportUrlProvider
     */
    public function __construct(
        Context $context,
        ReportUrlProvider $reportUrlProvider
    ) {
        $this->reportUrlProvider = $reportUrlProvider;
        parent::__construct($context);
    }

    /**
     * Redirect to resource with reports.
     *
     * @return Redirect $resultRedirect
     */
    public function execute()
    {
        /** @var Redirect $resultRedirect */
        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        try {
            $resultRedirect->setUrl($this->reportUrlProvider->getUrl());
        } catch (SubscriptionUpdateException $e) {
            $this->getMessageManager()->addNoticeMessage($e->getMessage());
            $resultRedirect->setPath('adminhtml');
        } catch (LocalizedException $e) {
            $this->getMessageManager()->addExceptionMessage($e, $e->getMessage());
            $resultRedirect->setPath('adminhtml');
        } catch (\Exception $e) {
            $this->getMessageManager()->addExceptionMessage(
                $e,
                __('Sorry, there has been an error processing your request. Please try again later.')
            );
            $resultRedirect->setPath('adminhtml');
        }

        return $resultRedirect;
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php
/**
 * Copyright  Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Analytics\Controller\Adminhtml\Reports;

use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
use Magento\Analytics\Model\Exception\State\SubscriptionUpdateException;
use Magento\Analytics\Model\ReportUrlProvider;
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Controller\Result\Redirect;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Exception\LocalizedException;

/**
 * Provide redirect to resource with reports.
 */
class Show extends Action implements HttpGetActionInterface
{
    /**
     * @var ReportUrlProvider
     */
    private $reportUrlProvider;

    /**
     * @inheritdoc
     */
    const ADMIN_RESOURCE = 'Magento_Analytics::advanced_reporting';

    /**
     * @param Context $context
     * @param ReportUrlProvider $reportUrlProvider
     */
    public function __construct(
        Context $context,
        ReportUrlProvider $reportUrlProvider
    ) {
        $this->reportUrlProvider = $reportUrlProvider;
        parent::__construct($context);
    }

    /**
     * Redirect to resource with reports.
     *
     * @return Redirect $resultRedirect
     */
    public function execute()
    {
        /** @var Redirect $resultRedirect */
        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
        try {
            $resultRedirect->setUrl($this->reportUrlProvider->getUrl());
        } catch (SubscriptionUpdateException $e) {
            $this->getMessageManager()->addNoticeMessage($e->getMessage());
            $resultRedirect->setPath('adminhtml');
        } catch (LocalizedException $e) {
            $this->getMessageManager()->addExceptionMessage($e, $e->getMessage());
            $resultRedirect->setPath('adminhtml');
        } catch (\Exception $e) {
            $this->getMessageManager()->addExceptionMessage(
                $e,
                __('Sorry, there has been an error processing your request. Please try again later.')
            );
            $resultRedirect->setPath('adminhtml');
        }

        return $resultRedirect;
    }
}

Function Calls

None

Variables

None

Stats

MD5 2101c5e81511f5a40e5beac5f46781c4
Eval Count 0
Decode Time 106 ms