mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-03 14:07:34 +00:00
changed classes marked as @final to final
This commit is contained in:
@@ -25,17 +25,11 @@ use Twig\Source;
|
||||
* display_end, constructor_start, constructor_end, and class_end.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @final since Twig 2.4.0
|
||||
*/
|
||||
class ModuleNode extends Node
|
||||
final class ModuleNode extends Node
|
||||
{
|
||||
public function __construct(Node $body, AbstractExpression $parent = null, Node $blocks, Node $macros, Node $traits, $embeddedTemplates, Source $source)
|
||||
{
|
||||
if (__CLASS__ !== \get_class($this)) {
|
||||
@trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$nodes = [
|
||||
'body' => $body,
|
||||
'blocks' => $blocks,
|
||||
|
||||
@@ -13,10 +13,8 @@ namespace Twig\Profiler;
|
||||
|
||||
/**
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @final since Twig 2.4.0
|
||||
*/
|
||||
class Profile implements \IteratorAggregate, \Serializable
|
||||
final class Profile implements \IteratorAggregate, \Serializable
|
||||
{
|
||||
const ROOT = 'ROOT';
|
||||
const BLOCK = 'block';
|
||||
@@ -32,10 +30,6 @@ class Profile implements \IteratorAggregate, \Serializable
|
||||
|
||||
public function __construct(string $template = 'main', string $type = self::ROOT, string $name = 'main')
|
||||
{
|
||||
if (__CLASS__ !== \get_class($this)) {
|
||||
@trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->template = $template;
|
||||
$this->type = $type;
|
||||
$this->name = 0 === strpos($name, '__internal_') ? 'INTERNAL' : $name;
|
||||
|
||||
@@ -15,10 +15,8 @@ namespace Twig\Sandbox;
|
||||
* Exception thrown when a not allowed filter is used in a template.
|
||||
*
|
||||
* @author Martin Hasoň <martin.hason@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class SecurityNotAllowedFilterError extends SecurityError
|
||||
final class SecurityNotAllowedFilterError extends SecurityError
|
||||
{
|
||||
private $filterName;
|
||||
|
||||
|
||||
@@ -15,10 +15,8 @@ namespace Twig\Sandbox;
|
||||
* Exception thrown when a not allowed function is used in a template.
|
||||
*
|
||||
* @author Martin Hasoň <martin.hason@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class SecurityNotAllowedFunctionError extends SecurityError
|
||||
final class SecurityNotAllowedFunctionError extends SecurityError
|
||||
{
|
||||
private $functionName;
|
||||
|
||||
|
||||
@@ -15,10 +15,8 @@ namespace Twig\Sandbox;
|
||||
* Exception thrown when a not allowed class method is used in a template.
|
||||
*
|
||||
* @author Kit Burton-Senior <mail@kitbs.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class SecurityNotAllowedMethodError extends SecurityError
|
||||
final class SecurityNotAllowedMethodError extends SecurityError
|
||||
{
|
||||
private $className;
|
||||
private $methodName;
|
||||
|
||||
@@ -15,10 +15,8 @@ namespace Twig\Sandbox;
|
||||
* Exception thrown when a not allowed class property is used in a template.
|
||||
*
|
||||
* @author Kit Burton-Senior <mail@kitbs.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class SecurityNotAllowedPropertyError extends SecurityError
|
||||
final class SecurityNotAllowedPropertyError extends SecurityError
|
||||
{
|
||||
private $className;
|
||||
private $propertyName;
|
||||
|
||||
@@ -15,10 +15,8 @@ namespace Twig\Sandbox;
|
||||
* Exception thrown when a not allowed tag is used in a template.
|
||||
*
|
||||
* @author Martin Hasoň <martin.hason@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class SecurityNotAllowedTagError extends SecurityError
|
||||
final class SecurityNotAllowedTagError extends SecurityError
|
||||
{
|
||||
private $tagName;
|
||||
|
||||
|
||||
@@ -21,10 +21,8 @@ use Twig\Token;
|
||||
* {% extends 'layout.html.twig' %}
|
||||
*
|
||||
* @author Yonel Ceruto <yonelceruto@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class DeprecatedTokenParser extends AbstractTokenParser
|
||||
final class DeprecatedTokenParser extends AbstractTokenParser
|
||||
{
|
||||
public function parse(Token $token)
|
||||
{
|
||||
|
||||
+1
-7
@@ -17,13 +17,11 @@ use Twig\Node\Node;
|
||||
/**
|
||||
* Represents a template filter.
|
||||
*
|
||||
* @final since Twig 2.4.0
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @see https://twig.symfony.com/doc/templates.html#filters
|
||||
*/
|
||||
class TwigFilter
|
||||
final class TwigFilter
|
||||
{
|
||||
private $name;
|
||||
private $callable;
|
||||
@@ -39,10 +37,6 @@ class TwigFilter
|
||||
*/
|
||||
public function __construct(string $name, $callable = null, array $options = [])
|
||||
{
|
||||
if (__CLASS__ !== \get_class($this)) {
|
||||
@trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->name = $name;
|
||||
$this->callable = $callable;
|
||||
$this->options = array_merge([
|
||||
|
||||
@@ -17,13 +17,11 @@ use Twig\Node\Node;
|
||||
/**
|
||||
* Represents a template function.
|
||||
*
|
||||
* @final
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @see https://twig.symfony.com/doc/templates.html#functions
|
||||
*/
|
||||
class TwigFunction
|
||||
final class TwigFunction
|
||||
{
|
||||
private $name;
|
||||
private $callable;
|
||||
@@ -39,10 +37,6 @@ class TwigFunction
|
||||
*/
|
||||
public function __construct(string $name, $callable = null, array $options = [])
|
||||
{
|
||||
if (__CLASS__ !== \get_class($this)) {
|
||||
@trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->name = $name;
|
||||
$this->callable = $callable;
|
||||
$this->options = array_merge([
|
||||
|
||||
+1
-7
@@ -16,13 +16,11 @@ use Twig\Node\Expression\TestExpression;
|
||||
/**
|
||||
* Represents a template test.
|
||||
*
|
||||
* @final since Twig 2.4.0
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @see https://twig.symfony.com/doc/templates.html#test-operator
|
||||
*/
|
||||
class TwigTest
|
||||
final class TwigTest
|
||||
{
|
||||
private $name;
|
||||
private $callable;
|
||||
@@ -38,10 +36,6 @@ class TwigTest
|
||||
*/
|
||||
public function __construct(string $name, $callable = null, array $options = [])
|
||||
{
|
||||
if (__CLASS__ !== \get_class($this)) {
|
||||
@trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->name = $name;
|
||||
$this->callable = $callable;
|
||||
$this->options = array_merge([
|
||||
|
||||
Reference in New Issue
Block a user