1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-11 16:59:45 +01:00
Commit Graph

390 Commits

Author SHA1 Message Date
Bruce Weirdan
3cd9658d29
Allow Override attribute to be used in pure contexts
Fixes vimeo/psalm#10731
2024-02-21 12:25:30 +01:00
George Steel
407c8b3084
Update PHP 8.2 stubs to include SensitiveParameterValue
Signed-off-by: George Steel <george@net-glue.co.uk>
2024-02-19 17:59:38 +00:00
a05a3a8aa9
Merge pull request #10709 from vimeo/improve_randomizer
Improve randomizer stubs
2024-02-15 11:57:45 +01:00
b238bc7dc9 Improve randomizer stubs 2024-02-15 11:51:41 +01:00
Valentin Udaltsov
07a64f6894 Improved Reflection stubs
ReflectionParameter::getPosition() is non-negative-int.
ReflectionMethod name property is always non-empty-string.
ReflectionAttribute::getTarget() returns Attribute::TARGET_* instead of int-mask. Even for attributes of promoted properties (https://3v4l.org/rpM1t).
*::getAttributes() always returns a list (https://3v4l.org/LYAMb).
2024-02-07 02:39:56 +03:00
fluffycondor
6aa2ddfe1c Fix ownerDocument type 2024-01-31 16:10:51 +06:00
Karl Thaler
b2e53f6cf8 Implement __set method in SimpleXMLElement 2024-01-09 15:28:23 -08:00
Antonio del Olmo
d6cf9faebb
Add support for Override attribute 2023-12-15 11:14:53 +01:00
761f390d9b Use same parameter names in stubs 2023-12-12 18:51:31 +01:00
Niels Dossche
6eba2f564c Fix return type of DOMXPath::query
This can also return namespace nodes, which are not a child class of
DOMNode.
2023-12-02 12:02:56 +01:00
kkmuffme
fdbd9b133c fix prefixed param and document it 2023-11-18 08:10:44 +01:00
kkmuffme
e9b0103c7f fix prefix 2023-11-18 08:03:30 +01:00
kkmuffme
a040ad1228 update decimal stubs from documented URL 2023-11-16 09:31:30 +01:00
orklah
b3ef6a0bd7
Merge pull request #10351 from robchett/rdkafka_stubs
Add stubs for rdKafka
2023-11-09 20:21:56 +01:00
Grégoire Paris
ba17015dfb
Allow int keys when calling Redis methods
In 5bfc0f960b, risky casting was invoked
as a way to show there is an issue here. However, it is not always
possible to use a string. For instance, there is no such thing as this
in PHP: ["1" => "whatever"]. If you try to create such an array, you
will obtain [1 => "whatever"] instead.

Ironically, this was copied in jetbrains/phpstorm, which is used in
PHPStan, which exhibited that false positive.

See https://github.com/JetBrains/phpstorm-stubs/pull/1454
2023-11-08 22:15:44 +01:00
robchett
3578b42e5c Add stubs for rdKafka
Fixes #3406
2023-11-08 09:51:12 +00:00
Simon Berger
6f32c723f5 Narrow down get_browser returning array or object based on $return_array param 2023-10-25 10:34:46 +02:00
Rudolph Gottesheim
87e0bbcf89 Allow passing stringable-objects to sprintf() in all PHP versions 2023-09-28 10:23:02 +02:00
Rudolph Gottesheim
aa04c0063b Allow Stringable in sprintf() values 2023-09-28 10:23:02 +02:00
Bruce Weirdan
ea1664f30b
Merge pull request #10190 from boesing/feature/array-object-array-key 2023-09-10 20:09:10 +03:00
Maximilian Bösing
e77a4bcbbe
feature: narrow key template for ArrayObject to array-key
This aligns behavior with PHPStan: ab154e1da5/stubs/ArrayObject.stub (L38)

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-09-10 15:54:08 +02:00
George Steel
e98ed16577
DateTimeZone::getName() always returns non-empty-string and cannot be constructed with an empty string
Signed-off-by: George Steel <george@net-glue.co.uk>
2023-09-09 23:48:49 +01:00
Bruce Weirdan
77436b1339
Merge pull request #10154 from cgocast/5.x 2023-08-27 05:27:41 +02:00
Bruce Weirdan
23ad49cbe4
Update mysqli stub
Refs vimeo/psalm#9851
2023-08-27 04:17:23 +02:00
cgocast
bb902990f8 Sink for ReflectionFunction::__construct() 2023-08-26 22:09:27 +02:00
cgocast
72c9bf8575 New sinks for TaintedCallable #10117 2023-08-26 19:29:00 +02:00
kkmuffme
4f87da19e2 stubs exec param-out for $output 2023-08-22 15:28:28 +02:00
Bruce Weirdan
32445023d8
strip_tags()/$allowed_tags can accept arrays since 7.4
Fixes vimeo/psalm#4317
2023-08-17 21:36:47 +02:00
The Devick
313267082b
Fix bcdiv nullable scale stub 2023-08-12 14:36:00 -03:00
Yannick Gottschalk
a4de6d9dc0 Fix #9997
- make SimpleXmlElement and SimpleXmlIterator not a universal object crate
- added typed magic __get method to SimpleXmlElement
- adjusted tests to reflect new behaviour of SimpleXmlElement
- added tests
2023-08-05 17:07:08 +02:00
Bruce Weirdan
c83b0c96a9
Fixed DOMDocument::load* signatures
Prior to 8.0 those methods could be called statically, returning a
`DOMDocument` instance. In 8.0 and above they no longer can be.
2023-08-01 11:56:46 +02:00
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