mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-19 05:46:41 +00:00
feature #2481 Mark Twig_Node_Module as final via an annotation (will be final in 3.0) (fabpot)
This PR was squashed before being merged into the 2.x branch (closes #2481). Discussion ---------- Mark Twig_Node_Module as final via an annotation (will be final in 3.0) Commits -------e5fb21f1added deprecation notices for @final classes93929e1dadded @final classes in the deprecated document3810368bmarked Twig_Node_Module as final via an annotation (will be final in 3.0)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
* 2.3.3 (2017-XX-XX)
|
||||
* 2.4.0 (2017-XX-XX)
|
||||
|
||||
* n/a
|
||||
* marked Twig_Node_Module as final via the @final annotation
|
||||
|
||||
* 2.3.2 (2017-04-20)
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.3-dev"
|
||||
"dev-master": "2.4-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-1
@@ -5,4 +5,14 @@ This document lists deprecated features in Twig 2.x. Deprecated features are
|
||||
kept for backward compatibility and removed in the next major release (a
|
||||
feature that was deprecated in Twig 2.x is removed in Twig 3.0).
|
||||
|
||||
There are no deprecated features for Twig 2.x.
|
||||
Final Classes
|
||||
-------------
|
||||
|
||||
The following classes are marked as ``@final`` in Twig 2 and will be final in
|
||||
3.0:
|
||||
|
||||
* ``Twig_Node_Module``
|
||||
* ``Twig_Filter``
|
||||
* ``Twig_Function``
|
||||
* ``Twig_Test``
|
||||
* ``Twig_Profiler_Profile``
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
class Twig_Environment
|
||||
{
|
||||
const VERSION = '2.3.3-DEV';
|
||||
const VERSION_ID = 20303;
|
||||
const VERSION = '2.4.0-DEV';
|
||||
const VERSION_ID = 20400;
|
||||
const MAJOR_VERSION = 2;
|
||||
const MINOR_VERSION = 3;
|
||||
const RELEASE_VERSION = 3;
|
||||
const MINOR_VERSION = 4;
|
||||
const RELEASE_VERSION = 0;
|
||||
const EXTRA_VERSION = 'DEV';
|
||||
|
||||
private $charset;
|
||||
|
||||
@@ -34,6 +34,10 @@ class Twig_Filter
|
||||
*/
|
||||
public function __construct(string $name, $callable = null, array $options = array())
|
||||
{
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
@trigger_error('Overriding '.__CLASS__.' is deprecated since version 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(array(
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
* display_end, constructor_start, constructor_end, and class_end.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @final since 2.4.0
|
||||
*/
|
||||
class Twig_Node_Module extends Twig_Node
|
||||
{
|
||||
@@ -25,6 +27,10 @@ class Twig_Node_Module extends Twig_Node
|
||||
|
||||
public function __construct(Twig_Node $body, Twig_Node_Expression $parent = null, Twig_Node $blocks, Twig_Node $macros, Twig_Node $traits, $embeddedTemplates, Twig_Source $source)
|
||||
{
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
@trigger_error('Overriding '.__CLASS__.' is deprecated since version 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->source = $source;
|
||||
|
||||
$nodes = array(
|
||||
|
||||
@@ -30,6 +30,10 @@ class Twig_Profiler_Profile implements IteratorAggregate, Serializable
|
||||
|
||||
public function __construct($template = 'main', $type = self::ROOT, $name = 'main')
|
||||
{
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
@trigger_error('Overriding '.__CLASS__.' is deprecated since version 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;
|
||||
|
||||
@@ -33,6 +33,10 @@ class Twig_Test
|
||||
*/
|
||||
public function __construct(string $name, $callable = null, array $options = array())
|
||||
{
|
||||
if (__CLASS__ !== get_class($this)) {
|
||||
@trigger_error('Overriding '.__CLASS__.' is deprecated since version 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(array(
|
||||
|
||||
Reference in New Issue
Block a user