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\AsynchronousOperations\Model;
use Magento\AsynchronousOperations\Model\OperationStatusPool;
use Magento\Framework\Exception\NoSuchEntityException;
use Doctrine\Instantiator\Exception\InvalidArgumentException;
/**
* Class OperationStatusValidator to validate operation status
*/
class OperationStatusValidator
{
/**
* @var OperationStatusPool
*/
private $operationStatusPool;
/**
* OperationStatusValidator constructor.
*
* @param OperationStatusPool $operationStatusPool
*/
public function __construct(OperationStatusPool $operationStatusPool)
{
$this->operationStatusPool = $operationStatusPool;
}
/**
* Validate method
*
* @param int $status
* @throws \InvalidArgumentException
* @return void
*/
public function validate($status)
{
$statuses = $this->operationStatusPool->getStatuses();
if (!in_array($status, $statuses)) {
throw new \InvalidArgumentException('Invalid Operation Status.');
}
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\AsynchronousOperations\Model;
use Magento\AsynchronousOperations\Model\OperationStatusPool;
use Magento\Framework\Exception\NoSuchEntityException;
use Doctrine\Instantiator\Exception\InvalidArgumentException;
/**
* Class OperationStatusValidator to validate operation status
*/
class OperationStatusValidator
{
/**
* @var OperationStatusPool
*/
private $operationStatusPool;
/**
* OperationStatusValidator constructor.
*
* @param OperationStatusPool $operationStatusPool
*/
public function __construct(OperationStatusPool $operationStatusPool)
{
$this->operationStatusPool = $operationStatusPool;
}
/**
* Validate method
*
* @param int $status
* @throws \InvalidArgumentException
* @return void
*/
public function validate($status)
{
$statuses = $this->operationStatusPool->getStatuses();
if (!in_array($status, $statuses)) {
throw new \InvalidArgumentException('Invalid Operation Status.');
}
}
}
Function Calls
None |
Stats
MD5 | 61abcf330c767b53bc4f35ec0be7b029 |
Eval Count | 0 |
Decode Time | 110 ms |