Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change classes marked as @final to final #2962

Merged
merged 1 commit into from
Apr 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/Node/ModuleNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,11 @@
* 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,
Expand Down
8 changes: 1 addition & 7 deletions src/Profiler/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@

/**
* @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';
Expand All @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions src/Sandbox/SecurityNotAllowedFilterError.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
* 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;

Expand Down
4 changes: 1 addition & 3 deletions src/Sandbox/SecurityNotAllowedFunctionError.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
* 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;

Expand Down
4 changes: 1 addition & 3 deletions src/Sandbox/SecurityNotAllowedMethodError.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
* 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;
Expand Down
4 changes: 1 addition & 3 deletions src/Sandbox/SecurityNotAllowedPropertyError.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
* 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;
Expand Down
4 changes: 1 addition & 3 deletions src/Sandbox/SecurityNotAllowedTagError.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
* 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;

Expand Down
4 changes: 1 addition & 3 deletions src/TokenParser/DeprecatedTokenParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
* {% 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)
{
Expand Down
8 changes: 1 addition & 7 deletions src/TwigFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
/**
* 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;
Expand All @@ -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([
Expand Down
8 changes: 1 addition & 7 deletions src/TwigFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
/**
* 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;
Expand All @@ -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([
Expand Down
8 changes: 1 addition & 7 deletions src/TwigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
/**
* 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;
Expand All @@ -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([
Expand Down