From 0ae39b5a341dbe877539013ef0209d039377050e Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Fri, 4 Feb 2022 19:11:13 +0000 Subject: [PATCH] Add a test for `SplFileObject::fstat()`. --- tests/PHPStan/Analyser/LegacyNodeScopeResolverTest.php | 4 ++++ tests/PHPStan/Analyser/data/functions.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tests/PHPStan/Analyser/LegacyNodeScopeResolverTest.php b/tests/PHPStan/Analyser/LegacyNodeScopeResolverTest.php index 92bdde96ae0..6f79bcd96c5 100644 --- a/tests/PHPStan/Analyser/LegacyNodeScopeResolverTest.php +++ b/tests/PHPStan/Analyser/LegacyNodeScopeResolverTest.php @@ -5562,6 +5562,10 @@ public function dataFunctions(): array 'array{0: int, 1: int, 2: int, 3: int, 4: int, 5: int, 6: int, 7: int, 8: int, 9: int, 10: int, 11: int, 12: int, dev: int, ino: int, mode: int, nlink: int, uid: int, gid: int, rdev: int, size: int, atime: int, mtime: int, ctime: int, blksize: int, blocks: int}|false', '$fstat', ], + [ + 'array{0: int, 1: int, 2: int, 3: int, 4: int, 5: int, 6: int, 7: int, 8: int, 9: int, 10: int, 11: int, 12: int, dev: int, ino: int, mode: int, nlink: int, uid: int, gid: int, rdev: int, size: int, atime: int, mtime: int, ctime: int, blksize: int, blocks: int}', + '$fileObjectStat', + ], [ 'string', '$base64DecodeWithoutStrict', diff --git a/tests/PHPStan/Analyser/data/functions.php b/tests/PHPStan/Analyser/data/functions.php index 7c36d6e8545..c71633634be 100644 --- a/tests/PHPStan/Analyser/data/functions.php +++ b/tests/PHPStan/Analyser/data/functions.php @@ -101,6 +101,8 @@ $stat = stat(__FILE__); $lstat = lstat(__FILE__); $fstat = fstat($resource); +$fileObject = new \SplFileObject(__FILE__); +$fileObjectStat = $fileObject->fstat(); $base64DecodeWithoutStrict = base64_decode(''); $base64DecodeWithStrictDisabled = base64_decode('', false);