Skip to content

Commit

Permalink
Require phpstan/phpstan:^2
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Dec 29, 2024
1 parent f337828 commit f171f83
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 37 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"infection/infection": "^0.26.0|^0.27.0|^0.28.0|^0.29.0",
"orisai/coding-standard": "^3.0.0",
"phpstan/extension-installer": "^1.0.0",
"phpstan/phpstan": "^1.0.0",
"phpstan/phpstan-deprecation-rules": "^1.0.0",
"phpstan/phpstan-phpunit": "^1.0.0",
"phpstan/phpstan-strict-rules": "^1.0.0",
"phpstan/phpstan": "^2.0.0",
"phpstan/phpstan-deprecation-rules": "^2.0.0",
"phpstan/phpstan-phpunit": "^2.0.0",
"phpstan/phpstan-strict-rules": "^2.0.0",
"phpunit/phpunit": "^9.5.0",
"staabm/annotate-pull-request-from-checkstyle": "^1.7.0"
},
Expand Down
24 changes: 12 additions & 12 deletions tests/Unit/VfsStreamWrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,9 @@ public function testFileTimesAreModifiedCorrectly(): void

$stat = stat("$this->scheme://file");

self::assertNotEquals(0, $stat['atime']);
self::assertNotEquals(0, $stat['mtime']);
self::assertNotEquals(0, $stat['ctime']);
self::assertNotSame(0, $stat['atime']);
self::assertNotSame(0, $stat['mtime']);
self::assertNotSame(0, $stat['ctime']);

$file->setAccessTime(10);
$file->setModificationTime(10);
Expand All @@ -524,7 +524,7 @@ public function testFileTimesAreModifiedCorrectly(): void
file_get_contents("$this->scheme://file");
$stat = stat("$this->scheme://file");

self::assertNotEquals(10, $stat['atime'], 'Access time has changed after read');
self::assertNotSame(10, $stat['atime'], 'Access time has changed after read');
self::assertSame(10, $stat['mtime'], 'Modification time has not changed after read');
self::assertSame(10, $stat['ctime'], 'inode change time has not changed after read');

Expand All @@ -536,8 +536,8 @@ public function testFileTimesAreModifiedCorrectly(): void
$stat = stat("$this->scheme://file");

self::assertSame(10, $stat['atime'], 'Access time has not changed after write');
self::assertNotEquals(10, $stat['mtime'], 'Modification time has changed after write');
self::assertNotEquals(10, $stat['ctime'], 'inode change time has changed after write');
self::assertNotSame(10, $stat['mtime'], 'Modification time has changed after write');
self::assertNotSame(10, $stat['ctime'], 'inode change time has changed after write');

$file->setAccessTime(10);
$file->setModificationTime(10);
Expand All @@ -548,7 +548,7 @@ public function testFileTimesAreModifiedCorrectly(): void

self::assertSame(10, $stat['atime'], 'Access time has not changed after inode change');
self::assertSame(10, $stat['mtime'], 'Modification time has not changed after inode change');
self::assertNotEquals(10, $stat['ctime'], 'inode change time has changed after inode change');
self::assertNotSame(10, $stat['ctime'], 'inode change time has changed after inode change');

$file->setAccessTime(10);
$file->setModificationTime(10);
Expand All @@ -571,8 +571,8 @@ public function testFileTimesAreModifiedCorrectly(): void
$stat = stat("$this->scheme://file");

self::assertSame(20, $stat['atime'], 'Access time has not changed after opening for writing');
self::assertNotEquals(20, $stat['mtime'], 'Modification time has changed after opnening for writing');
self::assertNotEquals(20, $stat['ctime'], 'inode change time has changed after opnening for writing');
self::assertNotSame(20, $stat['mtime'], 'Modification time has changed after opnening for writing');
self::assertNotSame(20, $stat['ctime'], 'inode change time has changed after opnening for writing');
}

public function testTouchFileCreation(): void
Expand Down Expand Up @@ -600,9 +600,9 @@ public function testTouchFileCreation(): void
touch("$this->scheme://file2");
$stat = stat("$this->scheme://file2");

self::assertNotEquals(20, $stat['atime'], 'Access time has changed after touch');
self::assertNotEquals(20, $stat['mtime'], 'Modification time has changed after touch');
self::assertNotEquals(20, $stat['ctime'], 'inode change time has changed after touch');
self::assertNotSame(20, $stat['atime'], 'Access time has changed after touch');
self::assertNotSame(20, $stat['mtime'], 'Modification time has changed after touch');
self::assertNotSame(20, $stat['ctime'], 'inode change time has changed after touch');
}

public function testTouchUpdatesTimes(): void
Expand Down
43 changes: 22 additions & 21 deletions tools/phpstan.baseline.neon
Original file line number Diff line number Diff line change
@@ -1,66 +1,67 @@
parameters:
ignoreErrors:
-
message: "#^Cannot access offset 'atime' on array\\{0\\: int, 1\\: int, 2\\: int, 3\\: int, 4\\: int, 5\\: int, 6\\: int, 7\\: int, \\.\\.\\.\\}\\|false\\.$#"
message: '#^Cannot access offset ''atime'' on array\{0\: int, 1\: int, 2\: int, 3\: int, 4\: int, 5\: int, 6\: int, 7\: int, \.\.\.\}\|false\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 7
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Cannot access offset 'ctime' on array\\{0\\: int, 1\\: int, 2\\: int, 3\\: int, 4\\: int, 5\\: int, 6\\: int, 7\\: int, \\.\\.\\.\\}\\|false\\.$#"
count: 2
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Cannot access offset 'mtime' on array\\{0\\: int, 1\\: int, 2\\: int, 3\\: int, 4\\: int, 5\\: int, 6\\: int, 7\\: int, \\.\\.\\.\\}\\|false\\.$#"
count: 3
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Offset 'message' might not exist on array\\{type\\: int, message\\: string, file\\: string, line\\: int\\}\\|null\\.$#"
message: '#^Offset ''message'' might not exist on array\{type\: int, message\: string, file\: string, line\: int\}\|null\.$#'
identifier: offsetAccess.notFound
count: 33
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Parameter \\#1 \\$group_id of function posix_getgrgid expects int, int\\|false given\\.$#"
message: '#^Parameter \#1 \$group_id of function posix_getgrgid expects int, int\|false given\.$#'
identifier: argument.type
count: 1
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Parameter \\#1 \\$stream of function fflush expects resource, resource\\|false given\\.$#"
message: '#^Parameter \#1 \$stream of function fflush expects resource, resource\|false given\.$#'
identifier: argument.type
count: 1
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Parameter \\#1 \\$stream of function flock expects resource, resource\\|false given\\.$#"
message: '#^Parameter \#1 \$stream of function flock expects resource, resource\|false given\.$#'
identifier: argument.type
count: 20
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Parameter \\#1 \\$stream of function fread expects resource, resource\\|false given\\.$#"
message: '#^Parameter \#1 \$stream of function fread expects resource, resource\|false given\.$#'
identifier: argument.type
count: 6
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Parameter \\#1 \\$stream of function fseek expects resource, resource\\|false given\\.$#"
message: '#^Parameter \#1 \$stream of function fseek expects resource, resource\|false given\.$#'
identifier: argument.type
count: 7
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Parameter \\#1 \\$stream of function ftell expects resource, resource\\|false given\\.$#"
message: '#^Parameter \#1 \$stream of function ftell expects resource, resource\|false given\.$#'
identifier: argument.type
count: 3
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Parameter \\#1 \\$stream of function ftruncate expects resource, resource\\|false given\\.$#"
message: '#^Parameter \#1 \$stream of function ftruncate expects resource, resource\|false given\.$#'
identifier: argument.type
count: 1
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|false given\\.$#"
message: '#^Parameter \#1 \$stream of function fwrite expects resource, resource\|false given\.$#'
identifier: argument.type
count: 9
path: ../tests/Unit/VfsStreamWrapperTest.php

-
message: "#^Parameter \\#1 \\$user_id of function posix_getpwuid expects int, int\\|false given\\.$#"
message: '#^Parameter \#1 \$user_id of function posix_getpwuid expects int, int\|false given\.$#'
identifier: argument.type
count: 2
path: ../tests/Unit/VfsStreamWrapperTest.php

0 comments on commit f171f83

Please sign in to comment.