Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8e0d41a

Browse files
minor #22894 Remove PHP<7 leftovers (chalasr)
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
2 parents 314fd0b + f0147da commit 8e0d41a

File tree

5 files changed

+2
-28
lines changed

5 files changed

+2
-28
lines changed

src/Symfony/Component/DependencyInjection/Tests/Compiler/FactoryReturnTypePassTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ public function testCircularReference()
9898
}
9999

100100
/**
101-
* @requires function ReflectionMethod::getReturnType
102101
* @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.
103102
*/
104103
public function testCompile()

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -780,11 +780,7 @@ public function serialize()
780780

781781
public function unserialize($data)
782782
{
783-
if (PHP_VERSION_ID >= 70000) {
784-
list($environment, $debug) = unserialize($data, array('allowed_classes' => false));
785-
} else {
786-
list($environment, $debug) = unserialize($data);
787-
}
783+
list($environment, $debug) = unserialize($data, array('allowed_classes' => false));
788784

789785
$this->__construct($environment, $debug);
790786
}

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ class PropertyAccessor implements PropertyAccessorInterface
7474
* @var array
7575
*/
7676
private $writePropertyCache = array();
77-
private static $previousErrorHandler = false;
78-
private static $errorHandler = array(__CLASS__, 'handleError');
7977
private static $resultProto = array(self::VALUE => null);
8078

8179
/**
@@ -173,24 +171,7 @@ public function setValue(&$objectOrArray, $propertyPath, $value)
173171
}
174172
} catch (\TypeError $e) {
175173
self::throwInvalidArgumentException($e->getMessage(), $e->getTrace(), 0);
176-
} finally {
177-
if (PHP_VERSION_ID < 70000 && false !== self::$previousErrorHandler) {
178-
restore_error_handler();
179-
self::$previousErrorHandler = false;
180-
}
181-
}
182-
}
183-
184-
/**
185-
* @internal
186-
*/
187-
public static function handleError($type, $message, $file, $line, $context)
188-
{
189-
if (E_RECOVERABLE_ERROR === $type) {
190-
self::throwInvalidArgumentException($message, debug_backtrace(false), 1);
191174
}
192-
193-
return null !== self::$previousErrorHandler && false !== call_user_func(self::$previousErrorHandler, $type, $message, $file, $line, $context);
194175
}
195176

196177
private static function throwInvalidArgumentException($message, $trace, $i)

src/Symfony/Component/Serializer/Tests/Encoder/JsonDecodeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public function decodeProvider()
5656
}
5757

5858
/**
59-
* @requires function json_last_error_msg
6059
* @dataProvider decodeProviderException
6160
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
6261
*/

src/Symfony/Component/Serializer/Tests/Encoder/JsonEncodeTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class JsonEncodeTest extends TestCase
1919
{
20-
private $encoder;
20+
private $encode;
2121

2222
protected function setUp()
2323
{
@@ -50,7 +50,6 @@ public function encodeProvider()
5050
}
5151

5252
/**
53-
* @requires function json_last_error_msg
5453
* @expectedException \Symfony\Component\Serializer\Exception\UnexpectedValueException
5554
*/
5655
public function testEncodeWithError()

0 commit comments

Comments
 (0)