1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00
Commit Graph

206 Commits

Author SHA1 Message Date
orklah
870ee4ff93 ->args to ->getArgs 2021-10-09 23:37:04 +02:00
Valentin Udaltsov
e7dd53d4d1 Refined PDO::errorInfo, PDOStatement::errorInfo
See https://www.php.net/manual/ru/pdo.errorcode.php and https://www.php.net/manual/ru/pdostatement.errorinfo.php.
2021-10-09 22:09:10 +03:00
Ishan Vyas
bdb494563e
chore: remove FiberExit class from Fiber stubs
Signed-off-by: Ishan Vyas <isvyas@gmail.com>
2021-10-09 12:31:52 +05:30
Ishan Vyas
b69e670060
chore: remove FiberExit class 2021-10-09 09:34:39 +05:30
Ishan Vyas
e917546801
feat: Add Fiber stubs
Signed-off-by: Ishan Vyas <isvyas@gmail.com>
2021-10-08 23:27:48 +05:30
Manuel VACELET
d561b29e4d ReflectionClass::getReflectionConstants has a filter parameter
It was introduced in php 8.0.

Fixes #6588
2021-10-05 14:15:28 +02:00
Tomas Norre Mikkelsen
960af957db Convert PSpell resources to objects 2021-10-04 13:41:31 +02:00
Tomas Norre Mikkelsen
4b8f212ab8 Fix incorrect parameters names 2021-10-04 12:58:03 +02:00
Tomas Norre Mikkelsen
993349d64d Convert LDAP resources to objects 2021-10-04 12:57:12 +02:00
orklah
73495d73e4
Merge pull request #6567 from tomasnorre/imap-rosource-to-object
Convert imap functions to use object instead of a resource
2021-10-04 00:35:04 +02:00
orklah
246f8173e0
Merge pull request #6566 from tomasnorre/fileinfo-resource-to-object
Convert finfo functions to use object instead of a resource
2021-10-04 00:34:48 +02:00
Ishan Vyas
79270c01fd
chore: make changes in CallMap.php file
Signed-off-by: Ishan Vyas <isvyas@gmail.com>
2021-10-03 22:32:17 +05:30
Ishan Vyas
5266114222
chore: make mime field optional
Signed-off-by: Ishan Vyas <isvyas@gmail.com>
2021-10-03 22:31:06 +05:30
Ishan Vyas
75755ac4dc
Add CURLStringFile in classmap delta 2021-10-03 12:09:13 +05:30
Tomas Norre Mikkelsen
232ebb7e57 Convert imap functions to use object instead of a resource 2021-10-02 11:58:08 +02:00
Tomas Norre Mikkelsen
518e18f128 Convert finfo functions to use object instead of a resource 2021-10-02 10:16:42 +02:00
Sergei Predvoditelev
31763b3628 Fix fopen 2021-09-30 17:12:54 +03:00
Paweł Słowik
096a6dbe5c Remove undocumented / untested XlsWriter methods 2021-09-28 17:56:20 +02:00
Paweł Słowik
e1727ffe22 Update XlsWriter signatures 2021-09-28 17:56:20 +02:00
Paweł Słowik
2e51a9a8a7 Permit null user_agent to get_browser() 2021-09-17 16:46:27 +02:00
Semyon
5c375cb3c0 Revert mb_str_split return signature to list<string> 2021-09-16 15:27:34 +03:00
ssnepenthe
655c000009 Update return type for xdebug_get_profiler_filename()
Returns false when profiler is not active, string otherwise
2021-09-14 13:45:23 -07:00
Christopher Bray
847f1e41e7 Make imageavif arguments optional 2021-09-08 09:17:06 +01:00
Christopher Bray
46f7a56e13 Add imageavif to CallMap 2021-09-07 22:07:02 +01:00
Christopher Bray
1bc6a231e0 Add imagecreatefromavif to CallMap 2021-09-07 22:03:31 +01:00
Bruce Weirdan
d17f1bd7b3
Merge pull request #6447 from brayniverse/master 2021-09-07 05:26:25 +03:00
Bruce Weirdan
5535ea1ac0
$column parameter is optional 2021-09-07 03:02:25 +03:00
Christopher Bray
ba84c990dd Add mysqli_fetch_column to CallMap 2021-09-06 22:34:25 +01:00
50bhan
58e1e6b9a3 Add an optional $options argument to hash functions for PHP 8.1 2021-09-07 01:44:35 +04:30
S.M. Ataur Rahman
5ec5f7d3db introducing fsync & fdatasync functions in callmap 2021-09-07 00:24:32 +06:00
Bruce Weirdan
e3e667653a
Merge pull request #6435 from SMAtaurRahman/php8.1 2021-09-06 17:27:17 +03:00
S.M. Ataur Rahman
b6e7a77e5a introducing mysqli execute() method parameter callmap change for php 8.1 2021-09-06 19:33:58 +06:00
Nicolas Giraud
b0444f2a7d Add missing definition of callmap in the history. 2021-09-06 15:22:33 +02:00
Nicolas Giraud
9df0edbbab Force array_walk to not infer input type. 2021-09-06 15:15:25 +02:00
Bruce Weirdan
36dfeed774
Converted ftp functions to use link object instead of a resource
Fixes vimeo/psalm#6403
2021-09-04 23:44:57 +03:00
orklah
9cd8917b88 create callmap for 8.1 and introduce array_is_list 2021-09-04 13:25:23 +02:00
Bruce Weirdan
cbcc38aab8
Merge pull request #6339 from niconoe-/allow-object-on-array_walk 2021-08-31 23:45:10 +03:00
Bruce Weirdan
c4f0386aff
Merge pull request #6375 from ThomasLandauer/issue-6358 2021-08-30 04:42:37 +03:00
ThomasLandauer
fa3fd10058 Fixing null for openssl_x509_parse() in CallMap_80_delta.php too :-) 2021-08-29 12:35:28 +02:00
ThomasLandauer
630529740c Fixing null for openssl_x509_parse() 2021-08-29 12:33:19 +02:00
Bruce Weirdan
624246b996
Merge pull request #6376 from orklah/use-variable-in-backtick 2021-08-29 04:39:13 +03:00
orklah
27b6d5ad3b fix psalm errors 2021-08-29 00:39:36 +02:00
ThomasLandauer
2210003c98 Fixing openssl_x509_parse() and openssl_x509_read() Closes #6358 2021-08-29 00:04:04 +02:00
Pol Dellaiera
f0d54128b6 Update return type of getInnerIterator which is always returning an iterator. 2021-08-24 15:27:02 +02:00
Nicolas Giraud
6cff8b627f Update also historical classmap. 2021-08-19 13:03:47 +02:00
Nicolas Giraud
e254ebf5d5 Allow object type to be given to array_walk and array_walk_recursive. 2021-08-19 12:03:06 +02:00
Benjamin Morel
621c4dd8d1 Enforce class-string in is_subclass_of() 2021-08-17 23:14:11 +02:00
Vincent Langlet
4b84793b2f Add false back for mb_str_split 2021-08-17 18:45:02 +02:00
Vincent Langlet
1cdad83630 Remove false if length is positive int 2021-08-17 17:47:22 +02:00
Vincent Langlet
786d926d78 str split return non empty 2021-08-17 11:03:54 +02:00
Marc Ole Bulling
1818609f43 Fix for #6318 2021-08-16 19:23:10 +02:00
Bruce Weirdan
babfb6a637
Fix histories 2021-08-16 02:52:18 +03:00
Tyson Andre
ff72d2c92e Fix issues in php 8.0 delta
In a last minute change in php 8.0 after the feature freeze,
PhpToken::getAll was changed to tokenize

Also, https://www.php.net/manual/en/function.mb-get-info
has been around since php 4.2 - it's in psalm/dictionaries/CallMap.php
already with the same signature. Same for ReflectionNamedType::isBuiltin

Also, add signatures for getAttributes.

Also, use the same param names for fdiv that are found in reflection in
php 8.0 and 8.1 to support named arguments
2021-08-15 19:28:44 -04:00
Bruce Weirdan
cc1335022f
Fix SimpleXMLIterator historic and current signatures
Historically, `SimpleXMLIterator` had only implemented `Iterator` and
`RecursiveIterator` methods. This changed in 8.0, when iterator methods
were moved to `SimpleXMLElement`, and `SimpleXMLIterator` was made a
dummy class extending `SimpleXMLElement`.

Fixes vimeo/psalm#6305, in the sense that Psalm would no longer report
different errors depending on the runtime PHP version.
2021-08-16 00:04:59 +03:00
Valentin Udaltsov
a335535945
Added debug_backtrace return type to CallMap_historical 2021-08-13 01:45:41 +03:00
Valentin Udaltsov
8b60ebebcf Refined debug_backtrace return type 2021-08-09 10:43:33 +03:00
Maurício Meneghini Fauth
1bc71522fb
Fix wrong return type for imagejpeg GD function
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-08 14:57:17 -03:00
Bruce Weirdan
66056e391b
Restored some callmap types 2021-08-08 19:50:16 +03:00
Bruce Weirdan
66466cea60
Clarify delta 7.1 docblock 2021-08-08 18:55:19 +03:00
Bruce Weirdan
8c531fec4b
Tweaks
Changed the format of the historical callmap to be plain signature list,
as it isn't really a delta file and renamed the file to not be confused
with deltas.

Added a test to ensure entries in main callmap have history.
2021-08-08 18:43:42 +03:00
bjscharp
90a09a7a9a Remove outdated line about removal from delta docblocks 2021-08-08 15:42:28 +02:00
bjscharp
88f15f0526 Fix version error in delta docblocks 2021-08-08 15:40:26 +02:00
bjscharp
ada1a60a4c Corrected docblock in historic delta file 2021-08-08 11:04:15 +02:00
bjscharp
96056d329f Add simple test to verify outout of getCallMap method
Convert deltafile format to new style proposed by weirdan
Modify CallMapTest to use new format
Modify InternalCallMapHandler to use new format
Move assertions to base testcase
2021-08-08 10:39:54 +02:00
bjscharp
f39c462138 Add missing bcadd function to 8.0 delta file.
To prevent similar errors, add baseline file with signatures pre-7.1, to help verify delta files are correct.
Modify test to use this to detect missing 'old' entries
2021-08-05 23:21:41 +02:00
bjscharp
4997208ee7 Merge branch 'master' into callmap-delta-inconsistencies
# Conflicts:
#	dictionaries/CallMap_80_delta.php
2021-08-05 22:03:32 +02:00
bjscharp
ac5ea252ff Added test to detect problems and inconsistencies in CallMap files
- Fixed inconsistencies in callmap delta files (mainly 8.0)
- Added several missing changes in the bc_* functions
- Added several missing changes in the mb_* functions
- Added several missing changes in the xml_parser_* functions
- Fixed several issues with sodium_ functions
- Removed all but one of the date_* functions. All were marked as having lost the option to return false, despite this only being true for date_format
2021-08-05 19:07:31 +02:00
Mason McElvain
b2ba774cb9 Update CallMap with PHP 8 date() signature 2021-08-04 15:27:32 -07:00
Mason McElvain
81661395ce Add old date signature to CallMap_80_delta 2021-08-04 15:26:42 -07:00
Mason McElvain
4d2a5b1bfa Permit null timestamp to date() in PHP 8
PHP 8 allows the timestamp to be null, but version 7.4 doesn't.
Creates a mapping for date() to allow $timestamp to be null in PHP 8.
2021-08-04 15:07:45 -07:00
Bruce Weirdan
e34a0e39d6
s/limit/length/ 2021-08-01 16:35:09 +03:00
bjscharp
e779387b9a Added missing mb_str_split function from 7.4 2021-08-01 15:12:07 +02:00
Bruce Weirdan
f952f1b616
exec() may fail
Fixes vimeo/psalm#6195
2021-07-28 13:38:49 +03:00
Bruce Weirdan
7aa5564047
Merge pull request #6192 from orklah/array_replace_not_nullable
make array_replace and array_replace_recursive not nullable
2021-07-28 00:20:46 +03:00
orklah
d9df3211c5 make array_replace and array_replace_recursive not nullable 2021-07-27 23:02:41 +02:00
Vincent Langlet
47fa2724d7 Add false as return type of shell_exec
The doc is only talking about string|null, but
false is possible when the pipe can't be etablished
@see https://github.com/php/php-src/pull/7306#issuecomment-886489235
2021-07-26 11:08:20 +02:00
Bruce Weirdan
6eee971109
Detailed signature for fputcsv and friends
Fixes vimeo/psalm#5226
2021-07-21 00:42:36 +03:00
Bruce Weirdan
a29cbd3c95
More callmap fixes
* `writeDtdEntity()`/`xmlwriter_write_dtd_entity()` has optional params
* `xmlwriter_write_attribute_ns` has `$namespace` param as nullable, not
`$content`
* `xmlwriter_write_element()`/`xmlwriter_write_element_ns()` has
`$content` param as optional
2021-07-17 23:37:32 +03:00
Arnout Boks
08a80dd238
Fix main callmap should contain newest signatures
https://github.com/vimeo/psalm/pull/6099#discussion_r671556027
2021-07-17 22:29:56 +03:00
Arnout Boks
f90e366398
Fix incorrect signature for XMLWriter::writeAttributeNs()
https://github.com/vimeo/psalm/pull/6099#discussion_r670604872
2021-07-17 22:29:56 +03:00
Arnout Boks
f304408662
Fix incorrect signature for xmlwriter_start_dtd 2021-07-17 22:29:56 +03:00
Arnout Boks
184505733d
Correct callmap entries for XMLWriter
Checked and fixed the following, based on the current
documentation in the PHP manual:

* capitalization in method names
* parameter names
* parameter types (especially for nullable params)
* return types (especially for '|false'-types)
* differences between pre- and post-8.0.0-signatures

Fixes #6091
2021-07-17 22:29:52 +03:00
Matthew Brown
88c4e2468e
Support interface-string<Foo> as temporary alias of class-string<Foo> (#6106) 2021-07-16 18:38:39 -04:00
François Kooman
fc641de85c radius_send_request returns int|false
https://github.com/LawnGnome/php-radius/blob/master/radius.c#L533
2021-07-16 09:07:29 +02:00
Bruce Weirdan
83bf9b8ed9
Merge pull request #5608 from paxal/patch/preg_replace_callback
Allow to use string key for preg_replace_callback callable argument
2021-07-11 04:55:03 +03:00
Fran Moreno
decb397b8e
Add ReflectionProperty::getType() and hasType() 2021-07-10 13:05:57 +02:00
Justin
f7a2aaef6e
Update DateTime and DateTimeImmutable signatures
`DateTime::format` and `DateTimeImmutable::format` will always
return a string starting in PHP 8.0.
2021-07-03 04:29:54 -04:00
Mikko Pesari
8443cd8d24 Update mbstring signatures for PHP 8 2021-07-02 16:12:43 +03:00
61f2af88be
Make producev parameters optional 2021-06-21 11:34:41 +02:00
d4311e3086
Fix wrong rdkafka commitAsync type (#5950) 2021-06-18 08:51:39 -04:00
Christer Edvartsen
3f0de269ee
Update signatures according to the PHP manual (#5904)
* Update signatures according to the PHP manual (#5903)

* Fix return type based on php-src
2021-06-07 13:20:32 -04:00
Bruce Weirdan
689315b05f
Fix sscanf() signature (#5901)
Fixes vimeo/psalm#5870
2021-06-07 13:19:17 -04:00
Bruce Weirdan
a4871c1ef8
Provide stricter types for spl_autoload functions (#5885) 2021-06-04 15:33:12 -04:00
Fran Moreno
76225e54f6
Make toPHP second parameter optional (#5864) 2021-06-01 11:24:13 -04:00
kesselb
36d670b955
Add false as return value for mb_convert_encoding (#5862) 2021-05-31 22:24:34 -04:00
Bruce Weirdan
997ffcda4c
Add $filter parameter to ReflectionClass::getConstants() (#5847)
Fixes vimeo/psalm#5837
2021-05-28 09:48:22 -04:00
orklah
67413c88f9
fix #5797 (#5822) 2021-05-23 19:12:02 -04:00
Fran Moreno
e89f7e3960
Add mongodb Cursor and CursorInterface stubs and fix WriteConcern::__construct (#5813)
* Add mongodb Cursor and CursorInterface stubs

* Use proper variable name

* Update WriteConcern constructor

Based on https://www.php.net/manual/es/mongodb-driver-writeconcern.construct.php
2021-05-22 19:03:07 -04:00
Cyril PASCAL
c45e47d8ad Allow to use string key for preg_replace_callback callable argument 2021-04-09 15:33:16 +02:00
Sergei Morozov
b627962e63
Fix oci8 stubs for PHP 8 (#5478) 2021-03-25 00:49:53 -04:00