748a74bb2c
Merge remote-tracking branch 'origin/4.x' into HEAD
2022-10-16 13:41:27 +02:00
Tim van Dijen
7144551940
Fix parameter + return type for lookupNamespaceURI + lookupPrefix
2022-10-11 13:05:49 +02:00
Alies Lapatsin
198a4ba9b0
Return non-empty-string by hash functions
2022-10-09 17:31:14 +03:00
Peter de Blieck
f1d1721fa7
Fixed function signatures of imap_delete and imap_undelete
2022-10-05 14:36:33 +02:00
Ricardo Boss
bf1c0320fd
Cherry-pick: Try to provide literal int types when possible ( fixes #6966 ) ( #7071 )
...
* Fixed vimeo/psalm#6966
* Only accept >= 0 values for mode argument in round()
* Made round() only return float or literal float values and remove unneeded test
* Registered RoundReturnTypeProvider
* Updated cast analyzer to handle single string literal int values as literal ints
* Fixed psalm errors
* Fix invalid property accesses
* Addressed comments
* Added Tests
* Marked RoundReturnTypeProvider as internal
* Fixed CS
2022-09-19 21:54:16 +02:00
orklah
8185260126
Merge pull request #8490 from tvdijen/setAttributeNS
...
Add null-type to several DOM-functions
2022-09-18 13:55:41 +02:00
Tim van Dijen
2a315bef45
Fix some more
2022-09-18 11:53:09 +02:00
Tim van Dijen
eb93f69251
Add null-type to several DOM-functions
2022-09-18 11:51:36 +02:00
George Steel
17ca8ef014
date_get_last_errors()
, DateTime::getLastErrors()
may return false
...
Up to PHP 8.2, these functions return false if no previous date operations have been performed. In PHP 8.2, false is returned after a date operation that yields neither warnings nor errors:
https://3v4l.org/HBq0q
https://3v4l.org/3QsKY
Signed-off-by: George Steel <george@net-glue.co.uk>
2022-09-13 23:51:32 +01:00
orklah
eba63a3821
Merge pull request #8367 from kkmuffme/revert-nullable-curl_multi_getcontent
...
partial revert nullable type for curl_multi_getcontent
2022-09-08 22:58:29 +02:00
kkmuffme
6e4c1823d6
partial revert nullable type for curl_multi_getcontent
...
Fix https://github.com/vimeo/psalm/issues/8351
Partially reverts f28ac73777
2022-09-08 21:46:15 +02:00
Andreas Braun
48bf5496d8
Add missing parameter type for Serializable::unserialize
2022-08-26 10:03:08 +02:00
Andreas Braun
5b8f611e73
Handle tentative return types for interfaces correctly
2022-08-25 15:27:04 +02:00
Andreas Braun
6a6922d29e
Update call maps for MongoDB extension
2022-08-25 14:35:54 +02:00
orklah
0d0a049eb2
Merge pull request #8405 from vjik/get-modifiers-name
...
Clarification of `Reflection::getModifierNames()` result type
2022-08-12 18:53:47 +02:00
Sergei Predvoditelev
ffe4375a60
Clarification of Reflection::getModifierNames()
result type
2022-08-12 16:03:56 +03:00
Paul Fedorow
8908638219
Fix imageinterlace
function signature
2022-08-12 11:22:45 +02:00
Marco Pivetta
a1ed84f1ed
Removed DateTimeImmutable::createFromMutable()
from the CallMap: fully covered by stub
2022-08-05 12:52:32 +02:00
Marco Pivetta
aaac9ccb90
Removed DateTimeImmutable::setTimestamp()
from the CallMap: fully covered by stub
...
Also simplified the return type from `static|false` to `static`, since
the method throws at all times, on failure.
On PHP 7.x, it could only fail if an invalid type was passed in, which is
not really valid anyway, from a type perspective.
Ref (PHP 8.1.x): 32d55f7422/ext/date/php_date.c (L3353-L3369)
Ref (PHP 7.0.33): bf574c2b67/ext/date/php_date.c (L3596-L3612)
2022-08-05 12:50:51 +02:00
Marco Pivetta
964f64a500
Removed DateTimeImmutable::setISODate()
from the CallMap: fully covered by stub
...
Also simplified the return type from `static|false` to `static`, since
the method throws at all times, on failure.
On PHP 7.x, it could only fail if an invalid type was passed in, which is
not really valid anyway, from a type perspective.
Ref (PHP 8.1.x): 32d55f7422/ext/date/php_date.c (L3308-L3324)
Ref (PHP 7.0.33): bf574c2b67/ext/date/php_date.c (L3549-L3565)
2022-08-05 12:49:45 +02:00
Marco Pivetta
0a6c9d0177
Removed DateTimeImmutable::setDate()
from the CallMap: fully covered by stub
...
Also simplified the return type from `static|false` to `static`, since
the method throws at all times, on failure.
On PHP 7.x, it could only fail if an invalid type was passed in, which is
not really valid anyway, from a type perspective.
Ref (PHP 8.1.x): 32d55f7422/ext/date/php_date.c (L3258-L3274)
Ref (PHP 7.0.33): bf574c2b67/ext/date/php_date.c (L3496-L3512)
2022-08-05 12:48:29 +02:00
Marco Pivetta
e61c593a2c
Removed DateTimeImmutable::setTime()
from the CallMap: fully covered by stub
...
Also simplified the return type from `static|false` to `static`, since
the method throws at all times, on failure.
On PHP 7.x, it could only fail if an invalid type was passed in, which is
not really valid anyway, from a type perspective.
Ref (PHP 8.1.x): 32d55f7422/ext/date/php_date.c (L3212-L3228)
Ref (PHP 7.0.33): bf574c2b67/ext/date/php_date.c (L3447-L3463)
2022-08-05 12:47:04 +02:00
Marco Pivetta
4fe554d6d2
Removed DateTimeImmutable::setTimezone()
from the CallMap: fully covered by stub
...
Also simplified the return type from `static|false` to `static`, since
the method throws at all times, on failure.
On PHP 7.x, it could only fail if an invalid type was passed in, which is
not really valid anyway, from a type perspective.
Ref (PHP 8.2.x): 534127d3b2/ext/date/php_date.c (L3291-L3307)
Ref (PHP 8.2.x): 534127d3b2/ext/date/php_date.stub.php (L517-L518)
Ref (PHP 7.0.33): bf574c2b67/ext/date/php_date.c (L3363-L3379)
2022-08-05 12:42:45 +02:00
Marco Pivetta
cb9939cbd3
Removed DateTimeImmutable::add()
from the CallMap: fully covered by stub
...
Ref: 534127d3b2/ext/date/php_date.stub.php (L511-L512)
Ref: 534127d3b2/ext/date/php_date.c (L3129-L3144)
2022-08-05 12:39:16 +02:00
Marco Pivetta
7cd3d49dc4
Removed DateTimeImmutable::modify()
from the CallMap: fully covered by stub
...
Also expanded the return type from `static` to `static|false`, since the
operation can fail (with a warning too), such as in following example:
https://3v4l.org/Xrjlc
```php
<?php
var_dump(
(new DateTimeImmutable())
->modify('potato')
);
```
Produces
```
Warning: DateTimeImmutable::modify(): Failed to parse time string (potato) at position 0 (p): The timezone could not be found in the database in /in/Xrjlc on line 6
bool(false)
```
Ref: 534127d3b2/ext/date/php_date.stub.php (L508-L509)
2022-08-05 12:37:24 +02:00
Marco Pivetta
18557b8c70
Removed DateTimeImmutable::diff()
from the CallMap: fully covered by stub
2022-08-05 12:34:31 +02:00
Marco Pivetta
002585b57e
Removed DateTimeImmutable::getTimestamp()
from the CallMap: fully covered by stub
...
This also simplifies the return type from `int|false` to always `int`,
since a timestamp can always be produced.
Ref: eff9aed159/ext/date/php_date.stub.php (L496-L500)
2022-08-05 12:32:26 +02:00
Marco Pivetta
1be04e0988
Removed DateTimeImmutable::getOffset()
from the CallMap: fully covered by stub
2022-08-05 12:27:29 +02:00
Marco Pivetta
2b6fddf88d
Removed DateTimeImmutable::getTimezone()
from the CallMap: fully covered by stub
...
Note: also verified that a `DateTimeImmutable#getTimezone()` always returns
a default timezone (initialized internally), and therefore restricted the
type a bit.
2022-08-05 12:26:59 +02:00
Marco Pivetta
7ee12c7493
Removed DateTimeImmutable::format()
from the CallMap: fully covered by stub
...
Note: some conditional return type magic was required here.
See: https://github.com/vimeo/psalm/pull/8350#discussion_r937089212
2022-08-05 12:24:35 +02:00
Marco Pivetta
58ca4e0b73
Removed DateTimeImmutable::createFromFormat()
from the CallMap: fully covered by stub
2022-08-05 12:23:43 +02:00
Marco Pivetta
267d76088d
Removed DateTimeImmutable::sub()
from the CallMap: fully covered by stub
2022-08-05 12:23:00 +02:00
Marco Pivetta
dc7d26abb1
Removed DateTimeImmutable::__construct
from the CallMap: fully covered by stub
2022-08-05 12:22:27 +02:00
Vincent Langlet
90ac39d89f
Fix formatCurrency return type
2022-07-30 23:31:21 +02:00
Mathieu Rochette
14241d74b3
ReflectionProperty::getValue $object is nullable since php 8.0
...
https://www.php.net/manual/en/reflectionproperty.getvalue.php
2022-07-29 22:14:12 +02:00
Honca
8b5999470a
Fixed ini_set types for arg value
2022-07-22 11:09:03 +02:00
orklah
4fbbf820d8
Merge pull request #8228 from othercorey/callmap-nullable
...
Fix nullable return types for CallMap functions
2022-07-14 09:03:35 +02:00
Corey Taylor
f28ac73777
Fix nullable return types for CallMap functions
2022-07-13 22:44:38 -05:00
orklah
057d78dc41
Merge pull request #8214 from BenMorel/geos2
...
Fix GEOSGeometry stubs with default values
2022-07-11 18:52:08 +02:00
Benjamin Morel
bcf3c5153c
Fix GEOSGeometry stubs with default values
2022-07-11 11:51:35 +02:00
AndrolGenhald
285740a753
Merge branch '4.x'
2022-07-07 15:01:38 -05:00
orklah
e28cd128db
Merge pull request #8217 from othercorey/fix-callmap-funcs
...
Fix several CallMap function signatures
2022-07-06 07:16:13 +02:00
Corey Taylor
b1e3094bae
Allow testing expected CallMap return types and ignore functions that currently fail
2022-07-05 17:32:34 -05:00
Corey Taylor
e0ebfe19a2
Fix class functions CallMap signatures
2022-07-05 15:36:09 -05:00
Corey Taylor
2469b6222d
Fix extract() CallMap signature
2022-07-05 15:36:09 -05:00
Corey Taylor
c71dcd581e
Fix fputcsv() CallMap signature
2022-07-05 15:36:09 -05:00
Corey Taylor
d0dcd543e4
Fix count() CallMap signature
2022-07-05 15:36:06 -05:00
orklah
9b4c8cb53f
Merge pull request #8151 from othercorey/fix-array-sigs
...
Fix array_* function signatures
2022-06-24 18:43:00 +02:00
orklah
cd54574616
Merge pull request #8152 from othercorey/fix-filter-var
...
Fix filter_var and filter_var_array signatures
2022-06-24 18:42:31 +02:00
Corey Taylor
3297e35d9a
Fix datefmt_* function signatures
2022-06-23 22:55:29 -05:00
Corey Taylor
e1e858512d
Fix filter_var and filter_var_array signatures
2022-06-23 21:50:41 -05:00
Corey Taylor
417bf87df0
Fix array_* function signatures
2022-06-23 20:32:29 -05:00
Corey Taylor
b9cae01855
Remove ldap functions dropped in php 8.0
2022-06-23 15:06:09 -05:00
Corey Taylor
b053253513
Fix signatures of ldap_* functions
2022-06-23 04:21:56 -05:00
Corey Taylor
07b335d068
Update ldap parameter to ldap_unbind in callmap
2022-06-20 06:59:36 -05:00
Benjamin Morel
d0cbf97e23
Add ReflectionClass::isEnum()
2022-06-17 16:42:21 +02:00
Alexandru Patranescu
4bafb96cee
allow decimal_separator and thousands_separator parameters to be nullable in PHP 7 and 8
2022-06-15 07:43:04 +03:00
Bitwise Operators
651ad6cb50
release:fix: Change return type of createFromInterface() methods on DateTime and DateTimeImmutable to 'static' so extending classes are recognized.
2022-06-13 14:41:02 +02:00
Sam Mousa
44b2ccb4b7
fix #8099 : ob_implicit_flush argument type changed to bool
2022-06-13 12:44:43 +02:00
orklah
e72e4488fc
Merge pull request #8042 from KevinVanSonsbeek/bugfix/splfileobject-fputcsv-invalidnamedargument
...
Bugfix/splfileobject fputcsv invalidnamedargument
2022-06-02 18:41:52 +02:00
Kevin van Sonsbeek
1042ececaf
Update the CallMap to have the correct param names
2022-06-02 00:30:58 +02:00
Vincent Langlet
087d7ce649
Update historical
2022-05-30 09:40:41 +03:00
Vincent Langlet
6352d9a855
Precise stat return type
2022-05-30 09:40:41 +03:00
Bruce Weirdan
e0acf22e40
Merge branch '4.x' into update-master
2022-05-28 14:49:12 -04:00
Mathieu Rochette
e2aafdeab2
Improve array_unique callmap stubs
...
see #7956
2022-05-23 21:19:00 +02:00
Matt Brown
fccc366c1e
Merge pull request #7887 from ging-dev/lsp-fixes
...
improve LSP
2022-04-27 10:13:17 -04:00
Matt Brown
5b91506926
cache statements even without persistent parser cache
2022-04-27 01:50:13 -04:00
Matt Brown
a9e3c1fdc1
Fix namespaced min/max int range keyword issue introduced in #7775 .
2022-04-27 01:44:57 -04:00
Matt Brown
20351c6667
Avoid json_encode when serializing non-UTF8 literals
...
`\Psalm\Internal\Clause::$hash` basically holds a hash on
arbitrary input literals, used for later comparison. Using
`json_encode` fails when dealing with non-UTF8 literals,
which has been replaced by plain PHP `serialize`.
Resolves : #7771
2022-04-27 01:42:37 -04:00
Matt Brown
043bbfbbb4
Remove useless array casting as CallMap for stream_select is reset.
2022-04-27 01:40:51 -04:00
Matt Brown
890375d908
Cast the read streams to an array while looping over as it can be NULL.
2022-04-27 01:39:30 -04:00
Matt Brown
d58736a550
fix #7747 : DateInterval::createFromDateString can be false
2022-04-27 01:32:38 -04:00
Paul Fedorow
b2d357fbb8
Fix return type of ldap_search
2022-04-23 14:55:46 +02:00
Mikko Pesari
161a8ae6c4
Fix openssl_csr_export() signature
2022-04-13 17:47:59 +03:00
hirokinoue
c6d7bc0d19
Improve Throwable::getTrace() return type
2022-04-12 23:42:37 +09:00
Daniel Kemper
2ee7ba32c7
changed return types of callmap
2022-04-12 08:49:40 +02:00
Daniel Kemper
114aad4c23
Resolve #7855 remove false from return type, in php8.0 and further versions there is a ValueError returned instead
2022-04-11 22:48:13 +02:00
Matthew Rardon
9c91912281
Fix ftp_fget/_fput/_nb_fget/_nb_fput arg types
2022-03-28 11:38:18 -04:00
Ciaran McNulty
0b39384325
Add return shape for Throwable::getTrace
...
This is based on the documentation for debug-backtrace:
https://php.net/debug_backtrace
Experimentation that shows the `object` field is not populated for exceptions:
https://3v4l.org/iQoni
And validation on psalm.dev:
https://psalm.dev/r/b35a8df2f3
2022-03-18 09:14:23 +00:00
Jack Worman
88f9e19acd
#7784 PDOStatement::fetchAll() has incorrect type
2022-03-14 14:11:31 -05:00
Ne-Lexa
a57bb1f128
fix #7747 : DateInterval::createFromDateString can be false
2022-03-05 22:37:55 +03:00
orklah
0fe6eaf5d9
Merge remote-tracking branch 'upstream/4.x' into upstream-master13
2022-02-26 21:26:59 +01:00
orklah
3a85f49268
Merge pull request #7673 from VincentLanglet/pdoException
...
PDOException extends RuntimeException and can use int code errors
2022-02-23 13:45:57 +01:00
Vincent Langlet
694157b2e0
PDOException extends RuntimeException and can use int code errors
2022-02-14 21:04:10 +01:00
Bruce Weirdan
edddc87002
Merge branch '4.x' into upstream-master
2022-02-13 07:14:23 +02:00
Chloé Kekoa
092f729e46
Correct name of ErrorException::__construct $line param
2022-02-13 01:19:33 +01:00
Bruce Weirdan
11e60fa261
Merge branch '4.x' into upstream-master
2022-02-11 03:51:48 +02:00
Marco Pivetta
fabcda16b4
Ensure trait_exists()
always returns bool
...
Fixes #7478
As discussed in the upstream issue, `trait_exists()` always returns `bool`: while
it can return `null` when the arguments passed to it do not match (either no arguments, or
3 or more arguments), we do not support that scenario, as that already doesn't respect the
type signature of this function.
We cut to the point: always make it `bool`, which is the scenario that works under healthy
operational conditions.
Ref: https://github.com/Roave/BetterReflection/pull/983#discussion_r790908170
Ref: https://psalm.dev/r/c41a43805d
Ref: https://github.com/vimeo/psalm/issues/7478#issuecomment-1020330351
Ref: https://github.com/vimeo/psalm/issues/7478#issuecomment-1020337712
Ref: https://3v4l.org/XpHmh
2022-02-01 16:51:09 +01:00
Bruce Weirdan
963b41d317
Merge branch '4.x' into upstream-master
2022-01-30 00:32:12 +02:00
orklah
9168cef2d4
Merge remote-tracking branch 'upstream/4.x' into upstream-master6
2022-01-26 21:06:25 +01:00
Kevin van Sonsbeek
5a1ddf5e2d
Fixed the return type in the callmap
2022-01-25 23:13:04 +01:00
Fabien Villepinte
6bf34b5b97
Add missing parameter to Phar::getMetadata()
2022-01-25 21:35:27 +01:00
orklah
841d4f4429
improve support for enum_exists
2022-01-22 18:27:24 +01:00
orklah
af1888b631
Merge remote-tracking branch 'upstream/4.x' into upstream-master4
2022-01-22 17:48:42 +01:00
Matthias Wirtz
5b23a0c51e
in array form all attributes are nullable since PHP 7.3
2022-01-22 15:34:16 +01:00
Matthias Wirtz
bb577ec271
change nullable for array signature to be equal to param signature
2022-01-22 15:26:26 +01:00
Alberto Piai
9b22d63c5b
fix proc_open stub for php >= 8.0
...
The argument names are defined here:
https://github.com/php/php-src/blob/PHP-8.0.0/ext/standard/basic_functions_arginfo.h#L1773-L1780
2022-01-20 13:57:34 +01:00
Rishi Kumar Ray
5e277d4060
Fix Incomplete return type for mb_split() function
2022-01-19 18:07:06 +05:30
5c3d9fd659
Fix kafka stubs
2022-01-19 10:14:09 +01:00
orklah
477c0113c2
Merge remote-tracking branch 'upstream/4.x' into upstream-master3
2022-01-18 18:37:04 +01:00