mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
This commit is contained in:
committed by
Fabien Potencier
parent
47c44e477c
commit
839f16145e
@@ -5,6 +5,7 @@ Backward incompatibilities:
|
||||
* the odd and even filters are now tests:
|
||||
{{ foo|odd }} must now be written {{ foo is odd }}
|
||||
|
||||
* fixed subscript expressions when calling __call() (methods now keep the case)
|
||||
* added a "trans" filter
|
||||
* added "test" feature (accessible via the "is" operator)
|
||||
* removed the debug tag (should be done in an extension)
|
||||
|
||||
@@ -138,10 +138,10 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
||||
}
|
||||
|
||||
// object method
|
||||
$item = strtolower($item);
|
||||
if (isset(self::$cache[$class]['methods'][$item])) {
|
||||
$lcItem = strtolower($item);
|
||||
if (isset(self::$cache[$class]['methods'][$lcItem])) {
|
||||
$method = $item;
|
||||
} elseif (isset(self::$cache[$class]['methods']['get'.$item])) {
|
||||
} elseif (isset(self::$cache[$class]['methods']['get'.$lcItem])) {
|
||||
$method = 'get'.$item;
|
||||
} elseif (isset(self::$cache[$class]['methods']['__call'])) {
|
||||
$method = $item;
|
||||
|
||||
@@ -41,14 +41,17 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
|
||||
// METHOD
|
||||
array('bar', $object, 'bar', array(), $methodType),
|
||||
array('bar', $object, 'getBar', array(), $methodType),
|
||||
array('bar', $object, 'getbar', array(), $methodType),
|
||||
array('foobar', $object, 'foobar', array(), $methodType),
|
||||
array('babar', $object, 'babar', array(), $methodType),
|
||||
array('babarStatic', $object, 'babarStatic', array(), $methodType),
|
||||
array('__call_baz', $objectMagic, 'baz', array(), $methodType),
|
||||
array('__call_Baz', $objectMagic, 'Baz', array(), $methodType),
|
||||
|
||||
// ANY
|
||||
array('foo', $object, 'foo', array(), $anyType),
|
||||
array('foo', $objectMagic, 'foo', array(), $anyType),
|
||||
array('Foo', $objectMagic, 'Foo', array(), $anyType),
|
||||
array(null, $object, 'null', array(), $anyType),
|
||||
);
|
||||
|
||||
@@ -134,7 +137,7 @@ class Twig_TemplateObjectArrayAccess implements ArrayAccess
|
||||
|
||||
class Twig_TemplateObjectMagic
|
||||
{
|
||||
public $attributes = array('foo' => 'foo');
|
||||
public $attributes = array('foo' => 'foo', 'Foo' => 'Foo');
|
||||
|
||||
public function __isset($name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user