8000 [ErrorHandler] Add types to constructors and private/final/internal m… · symfony/symfony@4f62641 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f62641

Browse files
committed
[ErrorHandler] Add types to constructors and private/final/internal methods.
1 parent c63bbb4 commit 4f62641

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/Symfony/Component/ErrorHandler/Tests/DebugClassLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function testClassAlias()
118118
/**
119119
* @dataProvider provideDeprecatedSuper
120120
*/
121-
public function testDeprecatedSuper($class, $super, $type)
121+
public function testDeprecatedSuper(string $class, string $super, string $type)
122122
{
123123
set_error_handler(function () { return false; });
124124
$e = error_reporting(0);
@@ -140,7 +140,7 @@ class_exists('Test\\'.__NAMESPACE__.'\\'.$class, true);
140140
$this->assertSame($xError, $lastError);
141141
}
142142

143-
public function provideDeprecatedSuper()
143+
public function provideDeprecatedSuper(): array
144144
{
145145
return [
146146
['DeprecatedInterfaceClass', 'DeprecatedInterface', 'implements'],

src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ public function testSendPhpResponse()
572572
/**
573573
* @dataProvider errorHandlerWhenLoggingProvider
574574
*/
575-
public function testErrorHandlerWhenLogging($previousHandlerWasDefined, $loggerSetsAnotherHandler, $nextHandlerIsDefined)
575+
public function testErrorHandlerWhenLogging(bool $previousHandlerWasDefined, bool $loggerSetsAnotherHandler, bool $nextHandlerIsDefined)
576576
{
577577
try {
578578
if ($previousHandlerWasDefined) {
@@ -612,7 +612,7 @@ public function testErrorHandlerWhenLogging($previousHandlerWasDefined, $loggerS
612612
}
613613
}
614614

615-
public function errorHandlerWhenLoggingProvider()
615+
public function errorHandlerWhenLoggingProvider(): iterable
616616
{
617617
foreach ([false, true] as $previousHandlerWasDefined) {
618618
foreach ([false, true] as $loggerSetsAnotherHandler) {

src/Symfony/Component/ErrorHandler/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static function setUpBeforeClass(): void
4141
/**
4242
* @dataProvider provideClassNotFoundData
4343
*/
44-
public function testHandleClassNotFound($error, $translatedMessage, $autoloader = null)
44+
public function testHandleClassNotFound(array $error, string $translatedMessage, callable $autoloader = null)
4545
{
4646
if ($autoloader) {
4747
// Unregister all autoloaders to ensure the custom provided
@@ -67,7 +67,7 @@ public function testHandleClassNotFound($error, $translatedMessage, $autoloader
6767
$this->assertSame($error['line'], $exception->getLine());
6868
}
6969

70-
public function provideClassNotFoundData()
70+
public function provideClassNotFoundData(): array
7171
{
7272
$autoloader = new ComposerClassLoader();
7373
$autoloader->add('Symfony\Component\ErrorHandler\Exception\\', realpath(__DIR__.'/../../Exception'));

src/Symfony/Component/ErrorHandler/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class UndefinedFunctionFatalErrorHandlerTest extends TestCase
2020
/**
2121
* @dataProvider provideUndefinedFunctionData
2222
*/
23-
public function testUndefinedFunction($error, $translatedMessage)
23+
public function testUndefinedFunction(array $error, string $translatedMessage)
2424
{
2525
$handler = new UndefinedFunctionFatalErrorHandler();
2626
$exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
@@ -33,7 +33,7 @@ public function testUndefinedFunction($error, $translatedMessage)
3333
$this->assertSame($error['line'], $exception->getLine());
3434
}
3535

36-
public function provideUndefinedFunctionData()
36+
public function provideUndefinedFunctionData(): array
3737
{
3838
return [
3939
[

src/Symfony/Component/ErrorHandler/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class UndefinedMethodFatalErrorHandlerTest extends TestCase
2020
/**
2121
* @dataProvider provideUndefinedMethodData
2222
*/
23-
public function testUndefinedMethod($error, $translatedMessage)
23+
public function testUndefinedMethod(array $error, string $translatedMessage)
2424
{
2525
$handler = new UndefinedMethodFatalErrorHandler();
2626
$exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
@@ -32,7 +32,7 @@ public function testUndefinedMethod($error, $translatedMessage)
3232
$this->assertSame($error['line'], $exception->getLine());
3333
}
3434

35-
public function provideUndefinedMethodData()
35+
public function provideUndefinedMethodData(): array
3636
{
3737
return [
3838
[

0 commit comments

Comments
 (0)
0