mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 03:16:34 +00:00
simplified code
This commit is contained in:
+1
-11
@@ -10,10 +10,6 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if (PHP_VERSION_ID >= 50600) {
|
||||
require_once __DIR__.'/twig_call_method.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Default base class for compiled templates.
|
||||
*
|
||||
@@ -593,13 +589,7 @@ abstract class Twig_Template
|
||||
// Some objects throw exceptions when they have __call, and the method we try
|
||||
// to call is not supported. If ignoreStrictCheck is true, we should return null.
|
||||
try {
|
||||
if (!$arguments) {
|
||||
$ret = $object->$method();
|
||||
} elseif (PHP_VERSION_ID >= 50600) {
|
||||
$ret = twig_call_method($object, $method, $arguments);
|
||||
} else {
|
||||
$ret = call_user_func_array(array($object, $method), $arguments);
|
||||
}
|
||||
$ret = $object->$method(...$arguments);
|
||||
} catch (BadMethodCallException $e) {
|
||||
if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
|
||||
return;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function twig_call_method($object, $method, $arguments)
|
||||
{
|
||||
return $object->$method(...$arguments);
|
||||
}
|
||||
Reference in New Issue
Block a user