mirror of
https://github.com/smarty-php/smarty.git
synced 2026-08-08 14:32:11 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 86f303b9f9 | |||
| cba469bf3e |
@@ -785,9 +785,11 @@ value(res) ::= ns1(c)DOUBLECOLON static_class_access(s). {
|
||||
if (isset($this->smarty->registered_classes[c])) {
|
||||
res = $this->smarty->registered_classes[c].'::'.s[0].s[1];
|
||||
} else {
|
||||
trigger_error('Using unregistered static method "' . c.'::'.s[0] . '" in a template is deprecated and will be ' .
|
||||
'removed in a future release. Use Smarty::registerClass to explicitly register ' .
|
||||
'a class for access.', E_USER_DEPRECATED);
|
||||
if (s[2] === 'method') {
|
||||
trigger_error('Using unregistered static method "' . c.'::'.s[0] . '" in a template is deprecated and will be ' .
|
||||
'removed in a future release. Use Smarty::registerClass to explicitly register ' .
|
||||
'a class for access.', E_USER_DEPRECATED);
|
||||
}
|
||||
res = c.'::'.s[0].s[1];
|
||||
}
|
||||
} else {
|
||||
@@ -1123,7 +1125,7 @@ static_class_access(res) ::= method(m) objectchain(oc). {
|
||||
|
||||
// static class constant
|
||||
static_class_access(res) ::= ID(v). {
|
||||
res = array(v, '');
|
||||
res = array(v, '', 'constant');
|
||||
}
|
||||
|
||||
// static class variables
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -255,8 +255,9 @@ class PhpFunctionTest extends PHPUnit_Smarty
|
||||
}
|
||||
|
||||
if ($shouldTriggerDeprecationNotice) {
|
||||
$this->assertStringContainsString('Using unregistered function', $errorMessage);
|
||||
$this->assertStringContainsString('Using unregistered ', $errorMessage);
|
||||
} else {
|
||||
$this->assertEquals('', $errorMessage);
|
||||
$this->assertEquals($expected, $output);
|
||||
$this->assertEquals('', $errorMessage);
|
||||
}
|
||||
@@ -295,6 +296,9 @@ class PhpFunctionTest extends PHPUnit_Smarty
|
||||
['{$a|addslashes}', '', true],
|
||||
['{$a|sha1}', '', true],
|
||||
['{$a|get_parent_class}', '', true],
|
||||
|
||||
['{StaticMethodsTesterClass::giveMeEmptyString($a)}', '', true],
|
||||
['{StaticMethodsTesterClass::EMPTY_STRING}', '', false],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -326,3 +330,12 @@ class TestIsset {
|
||||
return $v;
|
||||
}
|
||||
}
|
||||
|
||||
class StaticMethodsTesterClass {
|
||||
|
||||
const EMPTY_STRING = '';
|
||||
|
||||
public static function giveMeEmptyString($data) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user