1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Improve handling of array_search and strstr, and restrict ini_set types

This commit is contained in:
Matt Brown 2018-08-29 13:58:07 -04:00
parent f844f86a6c
commit 956a7c749b
5 changed files with 13 additions and 8 deletions

View File

@ -5343,7 +5343,7 @@ return [
'ini_get' => ['string|false', 'varname'=>'string'],
'ini_get_all' => ['array', 'extension='=>'?string', 'details='=>'bool'],
'ini_restore' => ['void', 'varname'=>'string'],
'ini_set' => ['string|false', 'varname'=>'string', 'newvalue'=>'string|int|float|bool'],
'ini_set' => ['string|false', 'varname'=>'string', 'newvalue'=>'string'],
'inotify_add_watch' => ['int', 'inotify_instance'=>'resource', 'pathname'=>'string', 'mask'=>'int'],
'inotify_init' => ['resource'],
'inotify_queue_len' => ['int', 'inotify_instance'=>'resource'],

View File

@ -494,6 +494,11 @@ class FunctionChecker extends FunctionLikeChecker
case 'strrpos':
case 'stripos':
case 'strripos':
case 'strstr':
case 'stristr':
case 'strrchr':
case 'strpbrk':
case 'array_search':
break;
default:

View File

@ -77,9 +77,9 @@ array_map(
$options = getopt(implode('', $valid_short_options), $valid_long_options);
if (!array_key_exists('use-ini-defaults', $options)) {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('memory_limit', 4 * 1024 * 1024 * 1024);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
ini_set('memory_limit', (string) (4 * 1024 * 1024 * 1024));
}
if (array_key_exists('help', $options)) {

View File

@ -7,8 +7,8 @@ use Psalm\IssueBuffer;
// show all errors
error_reporting(-1);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
ini_set('memory_limit', '2048M');
// get options from command line

View File

@ -1,7 +1,7 @@
<?php
ini_set('display_startup_errors', 1);
ini_set('html_errors', 1);
ini_set('display_startup_errors', '1');
ini_set('html_errors', '1');
ini_set('memory_limit', '-1');
error_reporting(E_ALL);