[TASK] Remove old PHP version leftovers 40/35940/4
authorMarkus Klein <klein.t3@reelworx.at>
Fri, 9 Jan 2015 21:31:56 +0000 (22:31 +0100)
committerSteffen Müller <typo3@t3node.com>
Sat, 31 Jan 2015 09:47:10 +0000 (10:47 +0100)
Releases: master
Resolves: #64670
Change-Id: Ia54cb96e20cd0392bd43cec366b3d8b9ab0a02df
Reviewed-on: http://review.typo3.org/35940
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Steffen Müller <typo3@t3node.com>
Tested-by: Steffen Müller <typo3@t3node.com>
typo3/sysext/core/Classes/Utility/ArrayUtility.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Classes/Utility/OpcodeCacheUtility.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/extbase/Classes/Property/TypeConverter/ObjectConverter.php
typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php

index e49e2cb..430ed56 100644 (file)
@@ -272,12 +272,7 @@ class ArrayUtility {
                if (empty($arrays)) {
                        return $arrays;
                }
-               // @ operator used: Some PHP versions like 5.4.4-14+deb7u8 (debian wheezy) are
-               // affected by PHP bug https://bugs.php.net/bug.php?id=50688 and trigger a warning.
-               // The code itself is ok and covered by unit tests, so the @ operator is used to
-               // suppress output of the PHP bug. This can be removed if the core does not
-               // support PHP version affected by this issue anymore.
-               $sortResult = @uasort($arrays, function (array $a, array $b) use ($key, $ascending) {
+               $sortResult = uasort($arrays, function (array $a, array $b) use ($key, $ascending) {
                        if (!isset($a[$key]) || !isset($b[$key])) {
                                throw new \RuntimeException('The specified sorting key "' . $key . '" is not available in the given array.', 1373727309);
                        }
index c95caa1..04d2812 100755 (executable)
@@ -2140,7 +2140,6 @@ class GeneralUtility {
                        } else {
                                // Just a value:
                                // Look for binary chars:
-                               // Check for length, because PHP 5.2.0 may crash when first argument of strcspn is empty
                                $vLen = strlen($v);
                                // Go for base64 encoding if the initial segment NOT matching any binary char has the same length as the whole string!
                                if ($vLen && strcspn($v, $binaryChars) != $vLen) {
index 24ede1c..64bc6e2 100644 (file)
@@ -105,20 +105,6 @@ class OpcodeCacheUtility {
        }
 
        /**
-        * Gets the state of canInvalidate for given cache system.
-        *
-        * @param string $system The cache system to test (APC, ...)
-        *
-        * @return bool The calculated value from array or FALSE if cache system not exists.
-        * @internal Do not rely on this function. Will be removed if PHP5.4 is minimum requirement.
-        */
-       static public function getCanInvalidate($system) {
-               return isset(static::$supportedCaches[$system])
-                       ? static::$supportedCaches[$system]['canInvalidate']
-                       : FALSE;
-       }
-
-       /**
         * Clears a file from an opcache, if one exists.
         *
         * @param string|NULL $fileAbsPath The file as absolute path to be cleared or NULL to clear completely.
index 7472239..3b1a925 100644 (file)
@@ -912,18 +912,14 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        'short mail address' => array('a@b.c'),
                        'simple mail address' => array('test@example.com'),
                        'uppercase characters' => array('QWERTYUIOPASDFGHJKLZXCVBNM@QWERTYUIOPASDFGHJKLZXCVBNM.NET'),
-                       // Fix / change if TYPO3 php requirement changed: Address ok with 5.2.6 and 5.3.2 but fails with 5.3.0 on windows
-                       // 'equal sign in local part' => array('test=mail@example.com'),
+                       'equal sign in local part' => array('test=mail@example.com'),
                        'dash in local part' => array('test-mail@example.com'),
                        'plus in local part' => array('test+mail@example.com'),
-                       // Fix / change if TYPO3 php requirement changed: Address ok with 5.2.6 and 5.3.2 but fails with 5.3.0 on windows
-                       // 'question mark in local part' => array('test?mail@example.com'),
+                       'question mark in local part' => array('test?mail@example.com'),
                        'slash in local part' => array('foo/bar@example.com'),
                        'hash in local part' => array('foo#bar@example.com'),
-                       // Fix / change if TYPO3 php requirement changed: Address ok with 5.2.6 and 5.3.2 but fails with 5.3.0 on windows
-                       // 'dot in local part' => array('firstname.lastname@employee.2something.com'),
-                       // Fix / change if TYPO3 php requirement changed: Address ok with 5.2.6, but not ok with 5.3.2
-                       // 'dash as local part' => array('-@foo.com'),
+                       'dot in local part' => array('firstname.lastname@employee.2something.com'),
+                       'dash as local part' => array('-@foo.com'),
                        'umlauts in domain part' => array('foo@äöüfoo.com')
                );
        }
@@ -957,17 +953,13 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        'closing parenthesis in local part' => array('foo)bar@example.com'),
                        'opening square bracket in local part' => array('foo[bar@example.com'),
                        'closing square bracket as local part' => array(']@example.com'),
-                       // Fix / change if TYPO3 php requirement changed: Address ok with 5.2.6, but not ok with 5.3.2
-                       // 'top level domain only' => array('test@com'),
+                       'top level domain only' => array('test@com'),
                        'dash as second level domain' => array('foo@-.com'),
                        'domain part starting with dash' => array('foo@-foo.com'),
                        'domain part ending with dash' => array('foo@foo-.com'),
                        'number as top level domain' => array('foo@bar.123'),
-                       // Fix / change if TYPO3 php requirement changed: Address not ok with 5.2.6, but ok with 5.3.2 (?)
-                       // 'dash as top level domain' => array('foo@bar.-'),
                        'dot at beginning of domain part' => array('test@.com'),
-                       // Fix / change if TYPO3 php requirement changed: Address ok with 5.2.6, but not ok with 5.3.2
-                       // 'local part ends with dot' => array('e.x.a.m.p.l.e.@example.com'),
+                       'local part ends with dot' => array('e.x.a.m.p.l.e.@example.com'),
                        'umlauts in local part' => array('äöüfoo@bar.com'),
                        'trailing whitespace' => array('test@example.com '),
                        'trailing carriage return' => array('test@example.com' . CR),
index d950ced..7bcb261 100644 (file)
@@ -221,24 +221,4 @@ class ObjectConverter extends AbstractTypeConverter implements \TYPO3\CMS\Core\S
                }
        }
 
-       /**
-        * This is a replacement for the functionality provided by is_a() with 3 parameters which is only available from
-        * PHP 5.3.9. It can be removed if the TYPO3 CMS PHP version requirement is raised to 5.3.9 or above.
-        *
-        * @param string $targetType
-        * @param string $originalTargetType
-        * @return string
-        * @throws \TYPO3\CMS\Extbase\Property\Exception\InvalidDataTypeException
-        */
-       protected function checkInheritanceChainWithoutIsA($targetType, $originalTargetType) {
-               $targetTypeToCompare = $targetType;
-               do {
-                       if ($targetTypeToCompare === $originalTargetType) {
-                               return $targetType;
-                       }
-               } while ($targetTypeToCompare = get_parent_class($targetTypeToCompare));
-
-               throw new \TYPO3\CMS\Extbase\Property\Exception\InvalidDataTypeException('The given type "' . $targetType . '" is not a subtype of "' . $originalTargetType . '".', 1360928582);
-       }
-
 }
index 84e9f28..d0821a7 100644 (file)
@@ -506,9 +506,7 @@ class TemplateParser {
 
                // PostParse Facet
                if ($viewHelper instanceof \TYPO3\CMS\Fluid\Core\ViewHelper\Facets\PostParseInterface) {
-                       // Don't just use $viewHelper::postParseEvent(...),
-                       // as this will break with PHP < 5.3.
-                       call_user_func(array($viewHelper, 'postParseEvent'), $currentViewHelperNode, $argumentsObjectTree, $state->getVariableContainer());
+                       $viewHelper::postParseEvent($currentViewHelperNode, $argumentsObjectTree, $state->getVariableContainer());
                }
 
                $this->callInterceptor($currentViewHelperNode, \TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface::INTERCEPT_OPENING_VIEWHELPER, $state);