Skip to content

Commit 30ae83d

Browse files
staabmsebastianbergmann
authored andcommitted
Fix PHPStan reported issues
1 parent 880de47 commit 30ae83d

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

src/Framework/ExecutionOrderDependency.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ public static function diff(array $left, array $right): array
136136

137137
public function __construct(string $classOrCallableName, ?string $methodName = null, bool $deepClone = false, bool $shallowClone = false)
138138
{
139+
$this->deepClone = $deepClone;
140+
$this->shallowClone = $shallowClone;
141+
139142
if ($classOrCallableName === '') {
140143
return;
141144
}
@@ -146,9 +149,6 @@ public function __construct(string $classOrCallableName, ?string $methodName = n
146149
$this->className = $classOrCallableName;
147150
$this->methodName = !empty($methodName) ? $methodName : 'class';
148151
}
149-
150-
$this->deepClone = $deepClone;
151-
$this->shallowClone = $shallowClone;
152152
}
153153

154154
public function __toString(): string

src/Framework/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ protected function setLocale(mixed ...$arguments): void
11851185
throw new Exception;
11861186
}
11871187

1188-
$this->locale[$category] = setlocale($category, 0);
1188+
$this->locale[$category] = setlocale($category, '0');
11891189

11901190
$result = setlocale(...$arguments);
11911191

src/Runner/Baseline/Reader.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ public function read(string $baselineFile): Baseline
8585

8686
$description = $issueElement->textContent;
8787

88-
assert(!empty($file));
8988
assert($line > 0);
9089
assert(!empty($hash));
9190
assert(!empty($description));

src/Runner/PhptTestCase.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ public function run(): void
186186
$jobResult = $this->phpUtil->runJob($code, $this->stringifyIni($settings));
187187
$this->output = $jobResult['stdout'] ?? '';
188188

189-
if (CodeCoverage::instance()->isActive() && ($coverage = $this->cleanupForCoverage())) {
189+
if (CodeCoverage::instance()->isActive()) {
190+
$coverage = $this->cleanupForCoverage();
191+
190192
CodeCoverage::instance()->codeCoverage()->start($this->filename, TestSize::large());
191193

192194
CodeCoverage::instance()->codeCoverage()->append(

src/TextUI/Output/Printer/DefaultPrinter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public static function standardError(): self
6969
*/
7070
private function __construct(string $out)
7171
{
72+
$this->isPhpStream = str_starts_with($out, 'php://');
73+
7274
if (str_starts_with($out, 'socket://')) {
7375
$tmp = explode(':', str_replace('socket://', '', $out));
7476

@@ -87,8 +89,6 @@ private function __construct(string $out)
8789
return;
8890
}
8991

90-
$this->isPhpStream = str_starts_with($out, 'php://');
91-
9292
if (!$this->isPhpStream && !Filesystem::createDirectory(dirname($out))) {
9393
throw new DirectoryDoesNotExistException(dirname($out));
9494
}

0 commit comments

Comments
 (0)