Initial commit: CloudOps infrastructure platform

This commit is contained in:
root
2026-04-09 19:58:57 +02:00
commit 1166a52f26
7762 changed files with 839452 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
namespace Mautic\IntegrationsBundle\Facade;
use Mautic\CoreBundle\Helper\EncryptionHelper;
class EncryptionService
{
public function __construct(
private EncryptionHelper $encryptionHelper,
) {
}
/**
* @param mixed $keys
*
* @return array|string
*/
public function encrypt($keys)
{
if (!is_array($keys)) {
return $this->encryptionHelper->encrypt($keys);
}
foreach ($keys as $name => $key) {
$keys[$name] = $this->encryptionHelper->encrypt($key);
}
return $keys;
}
/**
* @param bool $onlyPrimaryCipher
*
* @return array|string
*/
public function decrypt($keys, $onlyPrimaryCipher = false)
{
if (!is_array($keys)) {
return $this->encryptionHelper->decrypt($keys, $onlyPrimaryCipher);
}
foreach ($keys as $name => $key) {
$keys[$name] = $this->encryptionHelper->decrypt($key, $onlyPrimaryCipher);
}
return $keys;
}
}