From dca0e1647e7e8e15080b87c91b33a4528a85a689 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 6 Oct 2024 21:30:04 +0200 Subject: [PATCH] simplify --- resources/functionMap.php | 8 ++++---- src/Testing/PHPStanTestCase.php | 2 +- src/Testing/TestCaseSourceLocatorFactory.php | 2 +- .../StrictComparisonOfDifferentTypesRuleTest.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/functionMap.php b/resources/functionMap.php index 44aaf5104fe..f41b04c6dec 100644 --- a/resources/functionMap.php +++ b/resources/functionMap.php @@ -6403,8 +6403,8 @@ 'mcrypt_module_open' => ['resource|false', 'cipher'=>'string', 'cipher_directory'=>'string', 'mode'=>'string', 'mode_directory'=>'string'], 'mcrypt_module_self_test' => ['bool', 'algorithm'=>'string', 'lib_dir='=>'string'], 'mcrypt_ofb' => ['string', 'cipher'=>'string', 'key'=>'string', 'data'=>'string', 'mode'=>'int', 'iv='=>'string'], -'md5' => ['(non-falsy-string&numeric-string)|(non-falsy-string&lowercase-string)', 'str'=>'string', 'raw_output='=>'bool'], -'md5_file' => ['(non-falsy-string&numeric-string)|(non-falsy-string&lowercase-string)|false', 'filename'=>'string', 'raw_output='=>'bool'], +'md5' => ['(non-falsy-string&lowercase-string)', 'str'=>'string', 'raw_output='=>'bool'], +'md5_file' => ['(non-falsy-string&lowercase-string)|false', 'filename'=>'string', 'raw_output='=>'bool'], 'mdecrypt_generic' => ['string', 'td'=>'resource', 'data'=>'string'], 'Memcache::add' => ['bool', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'], 'Memcache::addServer' => ['bool', 'host'=>'string', 'port='=>'int', 'persistent='=>'bool', 'weight='=>'int', 'timeout='=>'int', 'retry_interval='=>'int', 'status='=>'bool', 'failure_callback='=>'callable', 'timeoutms='=>'int'], @@ -10446,8 +10446,8 @@ 'setRightFill' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'], 'setthreadtitle' => ['bool', 'title'=>'string'], 'settype' => ['bool', '&rw_var'=>'mixed', 'type'=>'string'], -'sha1' => ['(non-falsy-string&numeric-string)|(non-falsy-string&lowercase-string)', 'str'=>'string', 'raw_output='=>'bool'], -'sha1_file' => ['(non-falsy-string&numeric-string)|(non-falsy-string&lowercase-string)|false', 'filename'=>'string', 'raw_output='=>'bool'], +'sha1' => ['(non-falsy-string&lowercase-string)', 'str'=>'string', 'raw_output='=>'bool'], +'sha1_file' => ['(non-falsy-string&lowercase-string)|false', 'filename'=>'string', 'raw_output='=>'bool'], 'sha256' => ['string', 'str'=>'string', 'raw_output='=>'bool'], 'sha256_file' => ['string', 'filename'=>'string', 'raw_output='=>'bool'], 'shapefileObj::__construct' => ['void', 'filename'=>'string', 'type'=>'int'], diff --git a/src/Testing/PHPStanTestCase.php b/src/Testing/PHPStanTestCase.php index 4c65e34b8f9..14efcc7480e 100644 --- a/src/Testing/PHPStanTestCase.php +++ b/src/Testing/PHPStanTestCase.php @@ -54,7 +54,7 @@ abstract class PHPStanTestCase extends TestCase /** @deprecated */ public static bool $useStaticReflectionProvider = true; - /** @var array */ + /** @var array */ private static array $containers = []; /** @api */ diff --git a/src/Testing/TestCaseSourceLocatorFactory.php b/src/Testing/TestCaseSourceLocatorFactory.php index 1bb5ccd2912..a4921c9201a 100644 --- a/src/Testing/TestCaseSourceLocatorFactory.php +++ b/src/Testing/TestCaseSourceLocatorFactory.php @@ -26,7 +26,7 @@ final class TestCaseSourceLocatorFactory { - /** @var array> */ + /** @var array> */ private static array $composerSourceLocatorsCache = []; /** diff --git a/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php b/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php index a90e0da5cc6..4721b4e78bc 100644 --- a/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php +++ b/tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php @@ -1126,11 +1126,11 @@ public function testHashing(): void $this->checkAlwaysTrueStrictComparison = true; $this->analyse([__DIR__ . '/data/hashing.php'], [ [ - "Strict comparison using === between (lowercase-string&non-falsy-string)|(non-falsy-string&numeric-string) and 'ABC' will always evaluate to false.", + "Strict comparison using === between lowercase-string&non-falsy-string and 'ABC' will always evaluate to false.", 9, ], [ - "Strict comparison using === between (lowercase-string&non-falsy-string)|(non-falsy-string&numeric-string)|false and 'ABC' will always evaluate to false.", + "Strict comparison using === between (lowercase-string&non-falsy-string)|false and 'ABC' will always evaluate to false.", 12, ], [