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.
*/
declare(strict_types=1);
namespace Magento\Catalog\Pricing\Price;
use Magento\Catalog\Model\Product;
use Magento\Framework\Api\ExtensibleDataInterface;
use Magento\Framework\Pricing\Adjustment\CalculatorInterface;
use Magento\Catalog\Pricing\Price\ConfiguredPriceInterface;
/**
* Configured price selection model
*/
class ConfiguredPriceSelection
{
/**
* @var CalculatorInterface
*/
private $calculator;
/**
* @param CalculatorInterface $calculator
*/
public function __construct(
CalculatorInterface $calculator
) {
$this->calculator = $calculator;
}
/**
* Get Selection pricing list.
*
* @param ConfiguredPriceInterface $price
* @return array
*/
public function getSelectionPriceList(ConfiguredPriceInterface $price): array
{
$selectionPriceList = [];
foreach ($price->getOptions() as $option) {
$selectionPriceList = array_merge(
$selectionPriceList,
$this->createSelectionPriceList($option, $price->getProduct())
);
}
return $selectionPriceList;
}
/**
* Create Selection Price List.
*
* @param ExtensibleDataInterface $option
* @param Product $product
* @return array
*/
private function createSelectionPriceList(ExtensibleDataInterface $option, Product $product): array
{
return $this->calculator->createSelectionPriceList($option, $product);
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\Catalog\Pricing\Price;
use Magento\Catalog\Model\Product;
use Magento\Framework\Api\ExtensibleDataInterface;
use Magento\Framework\Pricing\Adjustment\CalculatorInterface;
use Magento\Catalog\Pricing\Price\ConfiguredPriceInterface;
/**
* Configured price selection model
*/
class ConfiguredPriceSelection
{
/**
* @var CalculatorInterface
*/
private $calculator;
/**
* @param CalculatorInterface $calculator
*/
public function __construct(
CalculatorInterface $calculator
) {
$this->calculator = $calculator;
}
/**
* Get Selection pricing list.
*
* @param ConfiguredPriceInterface $price
* @return array
*/
public function getSelectionPriceList(ConfiguredPriceInterface $price): array
{
$selectionPriceList = [];
foreach ($price->getOptions() as $option) {
$selectionPriceList = array_merge(
$selectionPriceList,
$this->createSelectionPriceList($option, $price->getProduct())
);
}
return $selectionPriceList;
}
/**
* Create Selection Price List.
*
* @param ExtensibleDataInterface $option
* @param Product $product
* @return array
*/
private function createSelectionPriceList(ExtensibleDataInterface $option, Product $product): array
{
return $this->calculator->createSelectionPriceList($option, $product);
}
}
Function Calls
None |
Stats
MD5 | a0e9c4fd888a69705e65302c91f9ec2e |
Eval Count | 0 |
Decode Time | 91 ms |