1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-14 18:36:58 +01:00
Commit Graph

10772 Commits

Author SHA1 Message Date
orklah
491213976b
Merge pull request #7301 from swiffer/4.x
change nullable for array signature to be equal to param signature
2022-01-22 16:28:33 +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
orklah
d1a946c221
Merge pull request #7454 from petewalker/feat/native-intersections
feat: Handle native intersection types
2022-01-22 11:18:54 +01:00
Pete Walker
be6ce777ff
chore: Better exception messages 2022-01-22 10:12:48 +00:00
Pete Walker
057a99c9f1
fix: Tests / minor bug 2022-01-22 00:00:45 +00:00
Oliver Hader
cad72004ab
Add deprecated method invocations to psalm-baseline.xml 2022-01-21 21:52:22 +01:00
Pete Walker
41a3807693
fix: Lint issue 2022-01-21 17:39:01 +00:00
Pete Walker
e2ebfd2ce3
Trigger CI 2022-01-21 17:35:21 +00:00
Pete Walker
299eca4daa
fix: Add PHP version checks / more tests 2022-01-21 17:31:48 +00:00
orklah
142b85a070
Merge pull request #7394 from veewee/function-params-provider-improvements
[TypeProvider] Provide argument types during FunctionParamsProviderEvent
2022-01-21 18:30:12 +01:00
Toon Verwerft
6b789bb5a7 [TypeProvider] Provide argument types during FunctionParamsProviderEvent 2022-01-21 16:32:40 +01:00
Oliver Hader
c34e32f60e
!!! Deprecate \Psalm\Plugin\RegistrationInterface methods
Following \Psalm\Plugin\RegistrationInterface methods are deprecated
+ addFileTypeScanner
+ addFileTypeAnalyzer

Following \Psalm\PluginRegistrationSocket methods are deprecated
+ addFileTypeScanner
+ getAdditionalFileTypeScanners
+ addFileTypeAnalyzer
+ getAdditionalFileTypeAnalyzers
+ getAdditionalFileExtensions
+ addFileExtension

Mentioned methods will be removed in Psalm v5.0, corresponding
functionality will be provided by following new interfaces and classes
+ \Psalm\Plugin\FileExtensionsInterface
+ \Psalm\PluginFileExtensionsSocket

Related: #6788
2022-01-21 14:51:36 +01:00
Pete Walker
a3bdf1ba8c
feat: Handle native intersection types
Adds native intersection type handling to psalm, removing the previous `UnexpectedValueException`.

Where an intersection is found in the parse tree, the types are resolved using the existing `Type::intersectUnionTypes` function, which I assume is being used when they're encountered in the existing docblock annotations.

I've added a handful of tests to cover this, but they're certainly not exhaustive. Are there any specific edge cases I should target?

This change feels way too simple... so apologies if I've missed something fundamental..!
2022-01-21 12:59:55 +00:00
orklah
f9ea2756f9
Merge pull request #7443 from brainlock/fix-proc-open-stub
fix proc_open stub for php >= 8.0
2022-01-21 13:00:39 +01:00
Alberto Piai
d39ccb50bf
unify argument names in historical and current CallMap for proc_open
Since before 8.0 the named arguments were not part of the interface, we
don't care about the intermediate steps of the proc_open definition. For
consistency, this makes the definition the same across all versions.

This also fixes the type for the `options` argument already in
CallMap_historical to be nullable.

The names of the arguments are now consistent across versions, while the
delta for 7.4 reflects the change of the `command` argument from
`string` to `string|array`.
2022-01-21 09:45:28 +01:00
orklah
f6369dc086
Merge pull request #7449 from orklah/7415-2
Array key exists assert both ways
2022-01-21 00:42:16 +01:00
orklah
35577dfd28 fix typo 2022-01-21 00:29:22 +01:00
orklah
f9b26acf6e Array key exists assert both ways 2022-01-21 00:26:37 +01:00
orklah
831f14d9e0
Merge pull request #7448 from orklah/nitpick
Nitpicks
2022-01-21 00:21:01 +01:00
orklah
f9e392316f remove unused imports 2022-01-21 00:17:06 +01:00
orklah
fe9d3f02a8 nitpicks 2022-01-20 23:47:41 +01:00
Matthew Brown
0a81f8cd6c
Use objects, not strings, for assertions (#7410)
* Use objects, not strings, for assertions

* Remove unnecessary param

* Remove some unnecessary checks

* Fix bad find/replace

* Add note about assertions no longer stored as strings in UPGRADING.md
2022-01-20 17:33:06 -05:00
orklah
65783c7930
Merge pull request #7446 from orklah/fix-ci2
fix tests
2022-01-20 22:19:35 +01:00
orklah
eb53f7e99c fix tests 2022-01-20 22:18:03 +01:00
orklah
6f1a5e8a47
Merge pull request #7417 from klimick/partially-applied-closure-inference
Contextual type inference for high order function arg
2022-01-20 21:03:46 +01:00
orklah
2f052a8781
Merge pull request #7437 from orklah/mb_internal_encoding
create a return type provider for mb_internal_encoding
2022-01-20 20:51:08 +01:00
orklah
2aeaadee5b
Merge pull request #7442 from M1ke/m1ke/config-threads
Allow config to define thread count
2022-01-20 19:39:00 +01:00
Matthew Brown
1ff3161584 Remove array_unique call 2022-01-20 11:36:18 -05:00
Matthew Brown
70479444e3 Remove untested likely-unnecessary code 2022-01-20 11:29:36 -05:00
Matthew Brown
473631fb34 Remove unused & untested code in AlgebraAnalyzer 2022-01-20 11:16:33 -05:00
m1ke
6107148fce Alter order of precedence and upated docs to match 2022-01-20 15:24:21 +00: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
m1ke
06aafa78ad Wording for threads config doc 2022-01-20 10:22:22 +00:00
m1ke
0dc4249d43 Fix phpcs 2022-01-20 10:09:15 +00:00
m1ke
df48eabbd2 Add new config item to docs 2022-01-20 09:50:12 +00:00
m1ke
2fdae4ae16 Use config threads if lower than detected threads 2022-01-20 09:50:01 +00:00
m1ke
1b8f337748 Allow psalm to load threads from the config 2022-01-20 09:49:45 +00:00
Vincent Quatrevieux
c7bfc03a6b
Merge branch '4.x' into call-docblock-method-using-parent 2022-01-20 08:59:50 +01:00
orklah
ac858e353d create a return type provider for mb_internal_encoding 2022-01-19 21:45:44 +01:00
orklah
5c4be6bc21
Merge pull request #7435 from orklah/old-phpunit
drop phpunit compatibility aliases
2022-01-19 20:36:44 +01:00
orklah
7d07f42790 fix CS 2022-01-19 20:36:09 +01:00
orklah
5a6dccd4a9
Merge pull request #7420 from orklah/remove-old-things
Remove forbidEcho
2022-01-19 20:32:19 +01:00
orklah
bbfdd57d5c
Merge pull request #7363 from zoonru/81_returntypewillchange
PHP 8.1: Report missing typehints in overridden native methods
2022-01-19 20:31:54 +01:00
orklah
4e5711030d
Merge pull request #7429 from ricardoboss/update-baseline-docs
Added documentation for baseline files
2022-01-19 20:02:08 +01:00
orklah
52a7f0694e drop compatibility aliases 2022-01-19 19:29:16 +01:00
orklah
d274d5241e
Merge pull request #7430 from b2pweb/resolve-generics-on-inherited-pseudo-methods
Resolve generics of inherited pseudo methods
2022-01-19 19:22:08 +01:00
orklah
84a4cbd3cf
Merge pull request #7432 from RishiKumarRay/fix-md.split
Fix Incomplete return type for mb_split() function
2022-01-19 18:47:35 +01:00
Vincent
f7252417e4 Fix typing (ref #7430) 2022-01-19 13:49:41 +01:00
Rishi Kumar Ray
5e277d4060 Fix Incomplete return type for mb_split() function 2022-01-19 18:07:06 +05:30