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 namespace Timber\Cache; class KeyGenerator { /** * @return string */..
Decoded Output download
<?php
namespace Timber\Cache;
class KeyGenerator
{
/**
* @return string
*/
public function generateKey(mixed $value)
{
if (\is_a($value, 'Timber\Cache\TimberKeyGeneratorInterface')) {
return $value->_get_cache_key();
}
if (\is_array($value) && isset($value['_cache_key'])) {
return $value['_cache_key'];
}
$key = \md5(\json_encode($value));
if (\is_object($value)) {
$key = $value::class . ';' . $key;
}
// Replace any of the reserved characters.
$key = \preg_replace('/[{}()\/\\@:]/', ';', $key);
return $key;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Timber\Cache;
class KeyGenerator
{
/**
* @return string
*/
public function generateKey(mixed $value)
{
if (\is_a($value, 'Timber\Cache\TimberKeyGeneratorInterface')) {
return $value->_get_cache_key();
}
if (\is_array($value) && isset($value['_cache_key'])) {
return $value['_cache_key'];
}
$key = \md5(\json_encode($value));
if (\is_object($value)) {
$key = $value::class . ';' . $key;
}
// Replace any of the reserved characters.
$key = \preg_replace('/[{}()\/\\\@:]/', ';', $key);
return $key;
}
}
Function Calls
None |
Stats
MD5 | 0394fc87b93b300312a6a0dc2b48d81c |
Eval Count | 0 |
Decode Time | 78 ms |