Skip to content

Commit 7aad5ac

Browse files
committed
test: apply rector fixes to FaultyStream
1 parent e4a9039 commit 7aad5ac

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;
@@ -103,6 +104,9 @@
103104
__DIR__ . '/system/HTTP/Response.php',
104105
],
105106

107+
// Keep property defaults for backward compatibility.
108+
RemoveDefaultValueFromAssignedPropertyRector::class,
109+
106110
ReadOnlyPropertyRector::class => [
107111
__DIR__ . '/system/Cache/ResponseCache.php',
108112
__DIR__ . '/system/HotReloader/IteratorFilter.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)