deprecated the 3rd argument of Sandbox error classes

This commit is contained in:
Fabien Potencier
2019-04-16 18:20:25 +02:00
parent 1119616c20
commit d8cb0f9764
6 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
* 2.8.1 (2019-XX-XX)
* deprecated passing a 4th and 5th arguments to the Sandbox exception classes
* deprecated passing a 3rd, 4th, and 5th arguments to the Sandbox exception classes
* deprecated Node::setTemplateName() in favor of Node::setSourceContext()
* 2.8.0 (2019-04-16)
@@ -24,6 +24,9 @@ class SecurityNotAllowedFilterError extends SecurityError
public function __construct(string $message, string $functionName, int $lineno = -1, string $filename = null, \Exception $previous = null)
{
if (-1 !== $lineno) {
@trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED);
}
if (null !== $filename) {
@trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED);
}
@@ -24,6 +24,9 @@ class SecurityNotAllowedFunctionError extends SecurityError
public function __construct(string $message, string $functionName, int $lineno = -1, string $filename = null, \Exception $previous = null)
{
if (-1 !== $lineno) {
@trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED);
}
if (null !== $filename) {
@trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED);
}
@@ -25,6 +25,9 @@ class SecurityNotAllowedMethodError extends SecurityError
public function __construct(string $message, string $className, string $methodName, int $lineno = -1, string $filename = null, \Exception $previous = null)
{
if (-1 !== $lineno) {
@trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED);
}
if (null !== $filename) {
@trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED);
}
@@ -25,6 +25,9 @@ class SecurityNotAllowedPropertyError extends SecurityError
public function __construct(string $message, string $className, string $propertyName, int $lineno = -1, string $filename = null, \Exception $previous = null)
{
if (-1 !== $lineno) {
@trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED);
}
if (null !== $filename) {
@trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED);
}
@@ -24,6 +24,9 @@ class SecurityNotAllowedTagError extends SecurityError
public function __construct(string $message, string $tagName, int $lineno = -1, string $filename = null, \Exception $previous = null)
{
if (-1 !== $lineno) {
@trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED);
}
if (null !== $filename) {
@trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED);
}