From 16ee8ceafd775777a99589b271ced8c1906a12d3 Mon Sep 17 00:00:00 2001 From: Pablo Largo Mohedano Date: Wed, 21 Jan 2026 00:33:30 +0100 Subject: [PATCH] Propose stricter types por SplFileInfo Those methods can return an empty string, but only if the instance is created with an empty string. I propose these changes in bleeding edge, as it would break the compatibility in the constructor. --- resources/functionMap_bleedingEdge.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/functionMap_bleedingEdge.php b/resources/functionMap_bleedingEdge.php index ff3eeb309f..c1dbd051b3 100644 --- a/resources/functionMap_bleedingEdge.php +++ b/resources/functionMap_bleedingEdge.php @@ -3,6 +3,12 @@ return [ 'new' => [ 'php_uname' => ['string', 'mode='=>'"a"|"s"|"n"|"r"|"v"|"m"'], + 'SplFileInfo::__construct' => ['void', 'filename'=>'non-empty-string'], + 'SplFileInfo::__toString' => ['non-empty-string'], + 'SplFileInfo::getBasename' => ['non-empty-string', 'suffix='=>'string'], + 'SplFileInfo::getFilename' => ['non-empty-string'], + 'SplFileInfo::getPathname' => ['non-empty-string'], + 'SplFileInfo::getRealPath' => ['non-empty-string|false'], ], 'old' => [ 'php_uname' => ['string', 'mode='=>'string'],