Remove PHP < 7.1 leftovers

This commit is contained in:
Robin Chalas 2017-05-24 18:36:02 +02:00
parent 6da68536f0
commit f0147dac80
5 changed files with 2 additions and 28 deletions

View File

@ -98,7 +98,6 @@ class FactoryReturnTypePassTest extends TestCase
} }
/** /**
* @requires function ReflectionMethod::getReturnType
* @expectedDeprecation Relying on its factory's return-type to define the class of service "factory" is deprecated since Symfony 3.3 and won't work in 4.0. Set the "class" attribute to "Symfony\Component\DependencyInjection\Tests\Fixtures\FactoryDummy" on the service definition instead. * @expectedDeprecation Relying on its factory's return-type to define the class of service "factory" is deprecated since Symfony 3.3 and won't work in 4.0. Set the "class" attribute to "Symfony\Component\DependencyInjection\Tests\Fixtures\FactoryDummy" on the service definition instead.
*/ */
public function testCompile() public function testCompile()

View File

@ -780,11 +780,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface
public function unserialize($data) public function unserialize($data)
{ {
if (PHP_VERSION_ID >= 70000) { list($environment, $debug) = unserialize($data, array('allowed_classes' => false));
list($environment, $debug) = unserialize($data, array('allowed_classes' => false));
} else {
list($environment, $debug) = unserialize($data);
}
$this->__construct($environment, $debug); $this->__construct($environment, $debug);
} }

View File

@ -141,8 +141,6 @@ class PropertyAccessor implements PropertyAccessorInterface
* @var array * @var array
*/ */
private $writePropertyCache = array(); private $writePropertyCache = array();
private static $previousErrorHandler = false;
private static $errorHandler = array(__CLASS__, 'handleError');
private static $resultProto = array(self::VALUE => null); private static $resultProto = array(self::VALUE => null);
/** /**
@ -240,26 +238,9 @@ class PropertyAccessor implements PropertyAccessorInterface
} }
} catch (\TypeError $e) { } catch (\TypeError $e) {
self::throwInvalidArgumentException($e->getMessage(), $e->getTrace(), 0); self::throwInvalidArgumentException($e->getMessage(), $e->getTrace(), 0);
} finally {
if (PHP_VERSION_ID < 70000 && false !== self::$previousErrorHandler) {
restore_error_handler();
self::$previousErrorHandler = false;
}
} }
} }
/**
* @internal
*/
public static function handleError($type, $message, $file, $line, $context)
{
if (E_RECOVERABLE_ERROR === $type) {
self::throwInvalidArgumentException($message, debug_backtrace(false), 1);
}
return null !== self::$previousErrorHandler && false !== call_user_func(self::$previousErrorHandler, $type, $message, $file, $line, $context);
}
private static function throwInvalidArgumentException($message, $trace, $i) private static function throwInvalidArgumentException($message, $trace, $i)
{ {
if (isset($trace[$i]['file']) && __FILE__ === $trace[$i]['file']) { if (isset($trace[$i]['file']) && __FILE__ === $trace[$i]['file']) {

View File

@ -56,7 +56,6 @@ class JsonDecodeTest extends TestCase
} }
/** /**
* @requires function json_last_error_msg
* @dataProvider decodeProviderException * @dataProvider decodeProviderException
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException * @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
*/ */

View File

@ -17,7 +17,7 @@ use Symfony\Component\Serializer\Encoder\JsonEncoder;
class JsonEncodeTest extends TestCase class JsonEncodeTest extends TestCase
{ {
private $encoder; private $encode;
protected function setUp() protected function setUp()
{ {
@ -50,7 +50,6 @@ class JsonEncodeTest extends TestCase
} }
/** /**
* @requires function json_last_error_msg
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException * @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
*/ */
public function testEncodeWithError() public function testEncodeWithError()