Skip to content

Commit bd278dd

Browse files
committed
test: apply rector fixes to FaultyStream
1 parent 9147eb5 commit bd278dd

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎rector.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector;
2626
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
2727
use Rector\DeadCode\Rector\MethodCall\RemoveNullArgOnNullDefaultParamRector;
28+
use Rector\DeadCode\Rector\Property\RemoveDefaultValueFromAssignedPropertyRector;
2829
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
2930
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
3031
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
@@ -100,6 +101,9 @@
100101
__DIR__ . '/system/HTTP/Response.php',
101102
],
102103

104+
// Keep property defaults for backward compatibility.
105+
RemoveDefaultValueFromAssignedPropertyRector::class,
106+
103107
// Exclude test file because `is_cli()` is mocked and Rector might remove needed parameters.
104108
RemoveExtraParametersRector::class => [
105109
__DIR__ . '/tests/system/Debug/ToolbarTest.php',

‎tests/_support/Session/FaultyStream.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static function reset(): void
5252
self::$failWrite = false;
5353
}
5454

55-
public function stream_open(string $path, string $mode, int $options, ?string &$openedPath): bool
55+
public function stream_open(): bool
5656
{
5757
$this->stream = fopen('php://temp', 'c+b');
5858

@@ -69,9 +69,9 @@ public function stream_write(string $data): false|int
6969
return self::$failWrite ? false : fwrite($this->stream, $data);
7070
}
7171

72-
public function stream_lock(int $operation): bool
72+
public function stream_lock(): bool
7373
{
74-
return self::$failLock ? false : true;
74+
return ! self::$failLock;
7575
}
7676

7777
public function stream_close(): void
@@ -110,7 +110,7 @@ public function stream_stat(): array
110110
*
111111
* @return array<string, int>
112112
*/
113-
public function url_stat(string $path, int $flags): array
113+
public function url_stat(): array
114114
{
115115
return [
116116
'dev' => 0,

0 commit comments

Comments
 (0)