Skip to content

Commit

Permalink
minor #22894 Remove PHP<7 leftovers (chalasr)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.0-dev branch.

Discussion
----------

Remove PHP<7 leftovers

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Forgot while cleaning up

Commits
-------

f0147da Remove PHP < 7.1 leftovers
  • Loading branch information
nicolas-grekas committed May 25, 2017
2 parents 314fd0b + f0147da commit 8e0d41a
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 28 deletions.
Expand Up @@ -98,7 +98,6 @@ public function testCircularReference()
}

/**
* @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.
*/
public function testCompile()
Expand Down
6 changes: 1 addition & 5 deletions src/Symfony/Component/HttpKernel/Kernel.php
Expand Up @@ -780,11 +780,7 @@ public function serialize()

public function unserialize($data)
{
if (PHP_VERSION_ID >= 70000) {
list($environment, $debug) = unserialize($data, array('allowed_classes' => false));
} else {
list($environment, $debug) = unserialize($data);
}
list($environment, $debug) = unserialize($data, array('allowed_classes' => false));

$this->__construct($environment, $debug);
}
Expand Down
19 changes: 0 additions & 19 deletions src/Symfony/Component/PropertyAccess/PropertyAccessor.php
Expand Up @@ -74,8 +74,6 @@ class PropertyAccessor implements PropertyAccessorInterface
* @var array
*/
private $writePropertyCache = array();
private static $previousErrorHandler = false;
private static $errorHandler = array(__CLASS__, 'handleError');
private static $resultProto = array(self::VALUE => null);

/**
Expand Down Expand Up @@ -173,24 +171,7 @@ public function setValue(&$objectOrArray, $propertyPath, $value)
}
} catch (\TypeError $e) {
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)
Expand Down
Expand Up @@ -56,7 +56,6 @@ public function decodeProvider()
}

/**
* @requires function json_last_error_msg
* @dataProvider decodeProviderException
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
*/
Expand Down
Expand Up @@ -17,7 +17,7 @@

class JsonEncodeTest extends TestCase
{
private $encoder;
private $encode;

protected function setUp()
{
Expand Down Expand Up @@ -50,7 +50,6 @@ public function encodeProvider()
}

/**
* @requires function json_last_error_msg
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
*/
public function testEncodeWithError()
Expand Down

0 comments on commit 8e0d41a

Please sign in to comment.