removed code specific to older versions of PHP

This commit is contained in:
Fabien Potencier
2016-10-24 14:48:05 -07:00
parent a4f31885a3
commit 273d0d3f98
3 changed files with 1 additions and 31 deletions
-19
View File
@@ -130,25 +130,6 @@ class Twig_Error extends Exception
$this->updateRepr();
}
/**
* For PHP < 5.3.0, provides access to the getPrevious() method.
*
* @param string $method The method name
* @param array $arguments The parameters to be passed to the method
*
* @return Exception The previous exception or null
*
* @throws BadMethodCallException
*/
public function __call($method, $arguments)
{
if ('getprevious' == strtolower($method)) {
return $this->previous;
}
throw new BadMethodCallException(sprintf('Method "Twig_Error::%s()" does not exist.', $method));
}
public function appendMessage($rawMessage)
{
$this->rawMessage .= $rawMessage;
+1 -10
View File
@@ -1,10 +1,5 @@
<?php
if (!defined('ENT_SUBSTITUTE')) {
// use 0 as hhvm does not support several flags yet
define('ENT_SUBSTITUTE', 0);
}
/*
* This file is part of Twig.
*
@@ -568,11 +563,7 @@ function twig_number_format_filter(Twig_Environment $env, $number, $decimal = nu
function twig_urlencode_filter($url)
{
if (is_array($url)) {
if (defined('PHP_QUERY_RFC3986')) {
return http_build_query($url, '', '&', PHP_QUERY_RFC3986);
}
return http_build_query($url, '', '&');
return http_build_query($url, '', '&', PHP_QUERY_RFC3986);
}
return rawurlencode($url);
@@ -1,7 +1,5 @@
--TEST--
__staticCall calls
--CONDITION--
version_compare(phpversion(), '5.3.0', '>=')
--TEMPLATE--
{{ 'foo'|magic_call_string }}
{{ 'foo'|magic_call_array }}