Skip to content

Commit 1a7eede

Browse files
committed
chore: type adjustments
1 parent 975e0f4 commit 1a7eede

File tree

60 files changed

+257
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+257
-232
lines changed

phpstan.neon

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
includes:
22
- vendor/phpstan/phpstan-strict-rules/rules.neon
3-
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
43

54
parameters:
6-
level: max
5+
level: 9
76
paths:
87
- src
98

10-
checkMissingIterableValueType: true
11-
reportUnmatchedIgnoredErrors: true

src/Boostrappers/BootPhpUnitSubscribers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @var array<int, class-string<Subscriber>>
2525
*/
26-
private const SUBSCRIBERS = [
26+
private const array SUBSCRIBERS = [
2727
DisplayInitialTestRunMessage::class,
2828
PrepareForInitialTestRun::class,
2929
EnsureInitialTestRunWasSuccessful::class,

src/Boostrappers/BootSubscribers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @var array<int, class-string<Subscriber>>
2525
*/
26-
private const SUBSCRIBERS = [
26+
private const array SUBSCRIBERS = [
2727
TrackMutationSuiteStart::class,
2828
TrackMutationSuiteFinish::class,
2929
StopOnUncoveredMutation::class,

src/Cache/FileStore.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class FileStore implements CacheInterface
1313
{
14-
private const CACHE_FOLDER_NAME = 'pest-mutate-cache';
14+
private const string CACHE_FOLDER_NAME = 'pest-mutate-cache';
1515

1616
private readonly string $directory;
1717

@@ -147,7 +147,7 @@ private function getPayload(string $key): mixed
147147
$expire = (int) substr(
148148
$content, 0, 10
149149
);
150-
} catch (Exception) { // @phpstan-ignore-line
150+
} catch (Exception) {
151151
$this->delete($key);
152152

153153
return $this->emptyPayload();
@@ -161,7 +161,7 @@ private function getPayload(string $key): mixed
161161

162162
try {
163163
$data = unserialize(substr($content, 10));
164-
} catch (Exception) { // @phpstan-ignore-line
164+
} catch (Exception) {
165165
$this->delete($key);
166166

167167
return $this->emptyPayload();

src/Mutation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717

1818
class Mutation
1919
{
20-
private const TMP_FOLDER = __DIR__
20+
private const string TMP_FOLDER = __DIR__
2121
.DIRECTORY_SEPARATOR
2222
.'..'
2323
.DIRECTORY_SEPARATOR
2424
.'.temp'
2525
.DIRECTORY_SEPARATOR
2626
.'mutations';
2727

28-
private const DIFF_SEPARATOR = '--- Expected'.PHP_EOL.'+++ Actual'.PHP_EOL.'@@ @@'.PHP_EOL;
28+
private const string DIFF_SEPARATOR = '--- Expected'.PHP_EOL.'+++ Actual'.PHP_EOL.'@@ @@'.PHP_EOL;
2929

3030
public function __construct(
3131
public readonly SplFileInfo $file,

src/MutationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ public function start(array $coveredLines, Configuration $configuration, array $
5252
foreach (range($this->mutation->startLine, $this->mutation->endLine) as $lineNumber) {
5353
foreach ($coveredLines[$this->mutation->file->getRealPath()][$lineNumber] ?? [] as $test) {
5454
preg_match('/\\\\([a-zA-Z0-9]*)::(__pest_evaluable_)?([^#]*)"?/', $test, $matches);
55-
if ($matches[2] === '__pest_evaluable_') { // @phpstan-ignore-line
56-
$filters[] = $matches[1].'::(.*)'.str_replace(['__', '_'], ['.{1,2}', '.'], $matches[3]); // @phpstan-ignore-line
55+
if ($matches[2] === '__pest_evaluable_') {
56+
$filters[] = $matches[1].'::(.*)'.str_replace(['__', '_'], ['.{1,2}', '.'], $matches[3]);
5757
} else {
58-
$filters[] = $matches[1].'::(.*)'.$matches[3]; // @phpstan-ignore-line
58+
$filters[] = $matches[1].'::(.*)'.$matches[3];
5959
}
6060
}
6161
}

src/Mutators.php

Lines changed: 185 additions & 185 deletions
Large diffs are not rendered by default.

src/Mutators/Abstract/AbstractFunctionCallUnwrapMutator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public static function nodesToHandle(): array
1919
return [FuncCall::class];
2020
}
2121

22+
#[\Override]
2223
public static function can(Node $node): bool
2324
{
2425
if (! $node instanceof FuncCall) {

src/Mutators/Abstract/AbstractFunctionReplaceMutator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public static function nodesToHandle(): array
1515
return [FuncCall::class];
1616
}
1717

18+
#[\Override]
1819
public static function can(Node $node): bool
1920
{
2021
if (! $node instanceof FuncCall) {

src/Mutators/Array/UnwrapArrayMap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public static function functionName(): string
2424
return 'array_map';
2525
}
2626

27+
#[\Override]
2728
public static function mutate(Node $node): Node
2829
{
2930
/** @var FuncCall $node */

0 commit comments

Comments
 (0)