From c31ce63221f067af3d00895e6c4c108d31de2157 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 5 Feb 2020 19:22:16 +0100 Subject: [PATCH] [Bridge/PhpUnit] fix parse error on PHP5 --- .../DeprecationErrorHandler/Deprecation.php | 2 +- .../DeprecationErrorHandler/DeprecationTest.php | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php index af9b4a539f..f4e9a8ff97 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php @@ -206,7 +206,7 @@ class Deprecation return self::TYPE_DIRECT; } - private function getOriginalFilesStack(): array + private function getOriginalFilesStack() { if (null === $this->originalFilesStack) { $this->originalFilesStack = []; diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php index 33b021c601..17638e458e 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php @@ -21,7 +21,7 @@ class DeprecationTest extends TestCase { private static $vendorDir; - private static function getVendorDir(): string + private static function getVendorDir() { if (null !== self::$vendorDir) { return self::$vendorDir; @@ -148,7 +148,7 @@ class DeprecationTest extends TestCase $this->assertTrue($deprecation->isMuted()); } - public function providerGetTypeDetectsSelf(): array + public function providerGetTypeDetectsSelf() { foreach (get_declared_classes() as $class) { if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) { @@ -187,7 +187,7 @@ class DeprecationTest extends TestCase /** * @dataProvider providerGetTypeDetectsSelf */ - public function testGetTypeDetectsSelf(string $expectedType, string $message, string $traceClass, string $file): void + public function testGetTypeDetectsSelf(string $expectedType, string $message, string $traceClass, string $file) { $trace = [ ['class' => 'MyClass1', 'function' => 'myMethod'], @@ -197,7 +197,7 @@ class DeprecationTest extends TestCase $this->assertSame($expectedType, $deprecation->getType()); } - public function providerGetTypeUsesRightTrace(): array + public function providerGetTypeUsesRightTrace() { $vendorDir = self::getVendorDir(); @@ -243,7 +243,7 @@ class DeprecationTest extends TestCase /** * @dataProvider providerGetTypeUsesRightTrace */ - public function testGetTypeUsesRightTrace(string $expectedType, string $message, array $trace): void + public function testGetTypeUsesRightTrace(string $expectedType, string $message, array $trace) { $deprecation = new Deprecation( $message, @@ -257,12 +257,12 @@ class DeprecationTest extends TestCase * This method is here to simulate the extra level from the piece of code * triggering an error to the error handler. */ - public function debugBacktrace(): array + public function debugBacktrace() { return debug_backtrace(); } - private static function removeDir($dir): void + private static function removeDir($dir) { $files = glob($dir.'/*'); foreach ($files as $file) { @@ -275,7 +275,7 @@ class DeprecationTest extends TestCase rmdir($dir); } - public static function tearDownAfterClass(): void + public static function tearDownAfterClass() { self::removeDir(self::getVendorDir().'/myfakevendor'); }