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.
*/
/**
* Catalog product option factory
*/
namespace Magento\Catalog\Model\Product\Option\Type;
class Factory
{
/**
* Object Manager
*
* @var \Magento\Framework\ObjectManagerInterface
*/
protected $_objectManager;
/**
* Construct
*
* @param \Magento\Framework\ObjectManagerInterface $objectManager
*/
public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager)
{
$this->_objectManager = $objectManager;
}
/**
* Create product option
*
* @param string $className
* @param array $data
* @return \Magento\Catalog\Model\Product\Option\Type\DefaultType
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function create($className, array $data = [])
{
$option = $this->_objectManager->create($className, $data);
if (!$option instanceof \Magento\Catalog\Model\Product\Option\Type\DefaultType) {
throw new \Magento\Framework\Exception\LocalizedException(
__('%1 doesn\'t extends \Magento\Catalog\Model\Product\Option\Type\DefaultType', $className)
);
}
return $option;
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* Catalog product option factory
*/
namespace Magento\Catalog\Model\Product\Option\Type;
class Factory
{
/**
* Object Manager
*
* @var \Magento\Framework\ObjectManagerInterface
*/
protected $_objectManager;
/**
* Construct
*
* @param \Magento\Framework\ObjectManagerInterface $objectManager
*/
public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager)
{
$this->_objectManager = $objectManager;
}
/**
* Create product option
*
* @param string $className
* @param array $data
* @return \Magento\Catalog\Model\Product\Option\Type\DefaultType
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function create($className, array $data = [])
{
$option = $this->_objectManager->create($className, $data);
if (!$option instanceof \Magento\Catalog\Model\Product\Option\Type\DefaultType) {
throw new \Magento\Framework\Exception\LocalizedException(
__('%1 doesn\'t extends \Magento\Catalog\Model\Product\Option\Type\DefaultType', $className)
);
}
return $option;
}
}
Function Calls
| None |
Stats
| MD5 | dafe97b6549bb6b23dc8f4bb247b42e3 |
| Eval Count | 0 |
| Decode Time | 124 ms |