added deprecation notices for @final classes

This commit is contained in:
Fabien Potencier
2017-05-22 08:12:29 +02:00
parent 93929e1ddd
commit e5fb21f1dd
3 changed files with 12 additions and 0 deletions
+4
View File
@@ -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(
+4
View File
@@ -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;
+4
View File
@@ -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(