1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00
Commit Graph

359 Commits

Author SHA1 Message Date
cgocast
719496b46e #10030 Add PDOStatement::bindValuebindValue() and PDOStatement::bindParam() as sources for TaintedSql 2023-07-21 15:27:47 +02:00
Andreas Braun
bea3090aff
Add generic stubs for MongoDB BSON classes 2023-07-13 08:42:06 +02:00
orklah
3e54feb9b4
Merge pull request #9964 from ygottschalk/fix/phpparser-deprecation-name-parts
Fix/phpparser deprecation name parts
2023-07-03 20:59:09 +02:00
kkmuffme
26eb870e47 fix mixed replace return types for arrays
* remove useless replace return type provider code that returned incorrect type for array replacements and was worse duplicate of existing stubs
* require preg patterns to be non-empty-strings as otherwise it will throw a PHP notice
* improve return type of array replacements to be more correct (not fully correct due to https://github.com/vimeo/psalm/issues/5994#issuecomment-1614601590)
2023-06-30 17:08:03 +02:00
Yannick Gottschalk
7aac142a44 Added stub for PhpParser\Node\Name 2023-06-28 03:13:42 +02:00
Yannick Gottschalk
f93d23899d Fix glob CallMap and stub to prevent crash on alpine (and possibly other systems) 2023-06-25 13:17:13 +02:00
kkmuffme
c5fee532f3 consistently ignore falsable return, remove unused suppress with new types 2023-06-24 18:11:15 +02:00
kkmuffme
7f0217d1e3 fix incorrect default stubs 2023-06-24 18:11:15 +02:00
robchett
5fc48bbb62 Add a stub file for Attributes defined by PHP 2023-06-17 12:26:56 +01:00
Sergei Morozov
9ac3e88c70
Unmark DateInterval::$invert as read-only
Despite the PHP documentation recommending that DateInterval properties
should be considered as read-only, there is no way to specify an
inverted interval via the constructor. Therefore, setting this property
on an existing object should not be considered an error.

See: https://www.php.net/manual/en/class.dateinterval.php
2023-06-11 16:43:51 -07:00
kkmuffme
1465ed7c23 fix CoreGenericFunctions.phpstub not falling back to callmap 2023-06-09 12:59:13 +02:00
kkmuffme
6e5fdac32e vprintf is pure too 2023-06-09 12:59:13 +02:00
kkmuffme
a0b87ad935 suppress PHP 7 issues and remove unspecific return type 2023-06-09 12:59:13 +02:00
kkmuffme
cf4536f646 fix incorrect return type of printf 2023-06-09 12:59:12 +02:00
Yannick Gottschalk
a130e2f06c Fixes #9820 2023-06-06 17:02:28 +02:00
kkmuffme
51d3276c03 Fix https://github.com/vimeo/psalm/issues/9839 2023-05-30 21:34:10 +02:00
Kamil Tekiela
c2bbc6239a Update CoreGenericFunctions.phpstub 2023-05-29 16:16:49 +01:00
RobChett
bd0ba6ee95 Narrow the type of haystack when strpos != false 2023-05-21 10:35:19 +01:00
Grégoire Paris
a6016e3072
Ignore nullable return form SimpleXMLElement::addChild()
It seems unrealistic to require users to perform a null check every time
they call this method.
2023-05-04 21:07:44 +02:00
orklah
40d4e560bc
Merge pull request #9691 from robchett/date_gmdate_return_type
Add return type provider for date/gmdate
2023-04-21 11:33:02 +02:00
RobChett
1a1d9c9bf5 Add return type provider for date/gmdate 2023-04-21 08:12:49 +01:00
RobChett
38d39c27ce Add stub for DateInterval 2023-04-20 15:52:29 +01:00
tuqqu
d3a21acc24 Fix array_flip to preserve non-empty array type 2023-04-13 22:19:44 +02:00
Claudio Zizza
4ec735e696
fix: add missing constructor parameter to IteratorIterator
The second parameter exist since PHP 5.1 and wasn't present in the docs before.
Even reflection wasn't showing this parameter until 8.0.
2023-04-13 00:14:26 +02:00
orklah
94f32e9718
Merge pull request #9323 from othercorey/fix-array-unique
Fix array_unique callmap
2023-03-28 20:27:18 +02:00
Corey Taylor
730bc221e9 Re-add array_unique() stub which preserved array type 2023-03-28 04:09:50 -05:00
orklah
b908f4491f
Merge pull request #9547 from phansys/mysqli
[mysql] Add stubs for `mysqli`, `mysqli_result` and `mysqli_stmt` classes
2023-03-27 21:01:19 +02:00
Javier Spagnoletti
b65a038553 [mysql] Add stubs for mysqli, mysqli_stmt and mysqli_result classes 2023-03-21 06:10:02 -03:00
fluffycondor
f3e950bac7 str_* functions assert for non-empty-string 2023-03-17 17:58:44 +06:00
fluffycondor
cf86b16199 Code style 2023-03-17 16:46:00 +06:00
fluffycondor
c2dae0e43f Add php8 str_* functions signatures 2023-03-17 16:39:04 +06:00
fluffycondor
2c69e3cdcc
Add explanation
Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
2023-03-16 12:37:14 +06:00
fluffycondor
0c3fa5b5d0 Add depth range
According to
https://www.php.net/manual/en/function.json-decode.php#:~:text=The%20value%20must%20be%20greater%20than%200%2C%20and%20less%20than%20or%20equal%20to%202147483647
2023-03-16 12:08:48 +06:00
fluffycondor
d11c7cdb8e Add JSON_THROW_ON_ERROR full support 2023-03-16 12:08:07 +06:00
Corey Taylor
39bb7b45a7 Fix return type of str_split() 2023-03-12 21:15:53 -05:00
fluffycondor
2abefb9618 Return a non-empty-string with JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE 2023-03-10 11:34:23 +06:00
Bruce Weirdan
468dd1be4c
PHP 8.2 attributes moved to 8.2 stub 2023-03-03 04:28:37 -04:00
Corey Taylor
615986ef10 Update pack() stub 2023-02-28 23:50:23 -06:00
Javier Spagnoletti
ab13ddf286 [ibm_db2] Improve return type inference for db2_autocommit() 2023-02-24 19:53:42 -03:00
Ulrich Eckhardt
4da0bede35 FFI Stubs: Extend FFI and FFI\CData definitions.
Both of these define "fuzzy" datatypes, which are mostly evaluated at runtime.
Currently, much of regular use of these will cause useless errors, so define
the stubs so that they simply support any kind of use that could happen.
2023-02-21 23:08:49 +01:00
Ulrich Eckhardt
056e1288eb FFI Stubs: Adjust FFI::new() stub. 2023-02-21 23:01:56 +01:00
Corey Taylor
3ddeecec1a Fix strpos stub return type 2023-02-16 13:34:39 -06:00
Bruce Weirdan
3693300b2d
Made WeakReference mutable
Fixes vimeo/psalm#6544
2023-02-14 19:30:28 -04:00
Kamil Tekiela
8eebebef62 Add curl stubs to prevent crashes 2023-02-13 16:39:40 +00:00
Corey Taylor
cdbd71ba8b Add DatePeriod::INCLUDE_END_DATE option 2023-02-03 13:37:45 -06:00
orklah
54cd529642
Merge pull request #9170 from mmcev106/filter-var-pure
Added @psalm-pure to filter_var()
2023-02-02 23:39:06 +01:00
Mark McEver
b5781c34e8 Fixed a case where the conditional taint, specialize, & flow features were not playing nicely together 2023-02-01 15:41:52 -06:00
Mark McEver
bb2cf1f30a Added @psalm-pure to filter_var() 2023-01-23 15:09:29 -06:00
orklah
a4d1b0691d
Merge pull request #9085 from BenMorel/newInstanceArgs
Fix ReflectionClass::newInstanceArgs() with named parameters
2023-01-19 23:08:21 +01:00
Jack Worman
787b9ae687 Fix dom_import_simplexml() 2023-01-18 18:31:54 -05:00