1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Add IssetTest

This commit is contained in:
Matt Brown 2018-06-01 11:16:42 -04:00
parent 9bbe437f22
commit 033bf3db16
2 changed files with 11 additions and 1 deletions

View File

@ -2753,7 +2753,7 @@ return [
'fgetss' => ['string|false', 'fp'=>'resource', 'length='=>'int', 'allowable_tags='=>'string'],
'file' => ['array<int,string>|false', 'filename'=>'string', 'flags='=>'int', 'context='=>'resource'],
'file_exists' => ['bool', 'filename'=>'string'],
'file_get_contents' => ['string|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'resource', 'offset='=>'int', 'maxlen='=>'int'],
'file_get_contents' => ['string|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'?resource', 'offset='=>'int', 'maxlen='=>'int'],
'file_put_contents' => ['int|false', 'file'=>'string', 'data'=>'mixed', 'flags='=>'int', 'context='=>'resource'],
'fileatime' => ['int|false', 'filename'=>'string'],
'filectime' => ['int|false', 'filename'=>'string'],

View File

@ -355,6 +355,16 @@ class IssetTest extends TestCase
}
}'
],
'issetVarInLoopBeforeAssignment' => [
'<?php
function foo() : void {
while (rand(0, 1)) {
if (!isset($foo)) {
$foo = 1;
}
}
}',
],
];
}