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 declare(strict_types=1); /** * CakePHP(tm) : Rapid Development Framework (https://..
Decoded Output download
<?php
declare(strict_types=1);
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @since 4.3.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Controller\Exception;
use Cake\Core\Exception\CakeException;
use Throwable;
/**
* Used when a passed parameter or action parameter type declaration is missing or invalid.
*/
class InvalidParameterException extends CakeException
{
/**
* @var array<string, string>
*/
protected array $templates = [
'failed_coercion' => 'Unable to coerce `%s` to `%s` for `%s` in action `%s::%s()`.',
'missing_dependency' => 'Failed to inject dependency from service container for parameter `%s` ' .
'with type `%s` in action `%s::%s()`.',
'missing_parameter' => 'Missing passed parameter for `%s` in action `%s::%s()`.',
'unsupported_type' => 'Type declaration for `%s` in action `%s::%s()` is unsupported.',
];
/**
* Switches message template based on `template` key in message array.
*
* @param array|string $message Either the string of the error message, or an array of attributes
* that are made available in the view, and sprintf()'d into Exception::$_messageTemplate
* @param int|null $code The error code
* @param \Throwable|null $previous the previous exception.
*/
public function __construct(array|string $message = '', ?int $code = null, ?Throwable $previous = null)
{
if (is_array($message)) {
$this->_messageTemplate = $this->templates[$message['template']] ?? '';
unset($message['template']);
}
parent::__construct($message, $code, $previous);
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @since 4.3.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Controller\Exception;
use Cake\Core\Exception\CakeException;
use Throwable;
/**
* Used when a passed parameter or action parameter type declaration is missing or invalid.
*/
class InvalidParameterException extends CakeException
{
/**
* @var array<string, string>
*/
protected array $templates = [
'failed_coercion' => 'Unable to coerce `%s` to `%s` for `%s` in action `%s::%s()`.',
'missing_dependency' => 'Failed to inject dependency from service container for parameter `%s` ' .
'with type `%s` in action `%s::%s()`.',
'missing_parameter' => 'Missing passed parameter for `%s` in action `%s::%s()`.',
'unsupported_type' => 'Type declaration for `%s` in action `%s::%s()` is unsupported.',
];
/**
* Switches message template based on `template` key in message array.
*
* @param array|string $message Either the string of the error message, or an array of attributes
* that are made available in the view, and sprintf()'d into Exception::$_messageTemplate
* @param int|null $code The error code
* @param \Throwable|null $previous the previous exception.
*/
public function __construct(array|string $message = '', ?int $code = null, ?Throwable $previous = null)
{
if (is_array($message)) {
$this->_messageTemplate = $this->templates[$message['template']] ?? '';
unset($message['template']);
}
parent::__construct($message, $code, $previous);
}
}
Function Calls
None |
Stats
MD5 | 3d5d18ef2d9f6205f493c932d83d3b03 |
Eval Count | 0 |
Decode Time | 86 ms |