/home/sharedstore/public_html/prestashop.sharedstore.ma/src/Core/Security
Edit: /home/sharedstore/public_html/prestashop.sharedstore.ma/src/Core/Security/GeneralConfiguration.php (2333B)
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
declare(strict_types=1);
namespace PrestaShop\PrestaShop\Core\Security;
use PrestaShop\PrestaShop\Core\Configuration\DataConfigurationInterface;
use PrestaShop\PrestaShop\Core\ConfigurationInterface;
/**
* Responsible for saving configuration options for security
*/
class GeneralConfiguration implements DataConfigurationInterface
{
/**
* @var ConfigurationInterface
*/
private $configuration;
/**
* @param ConfigurationInterface $configuration
*/
public function __construct(ConfigurationInterface $configuration)
{
$this->configuration = $configuration;
}
/**
* {@inheritdoc}
*/
public function getConfiguration()
{
return [
'token' => $this->configuration->get('PS_SECURITY_TOKEN'),
];
}
/**
* {@inheritdoc}
*/
public function updateConfiguration(array $configuration)
{
if ($this->validateConfiguration($configuration)) {
$this->configuration->set('PS_SECURITY_TOKEN', $configuration['token']);
}
return [];
}
/**
* {@inheritdoc}
*/
public function validateConfiguration(array $configuration)
{
return isset($configuration['token']);
}
}