1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
Commit Graph

4865 Commits

Author SHA1 Message Date
orklah
5c2336f4d0 skip a test because we removed the feature for now 2022-02-11 21:53:29 +01:00
Bruce Weirdan
11e60fa261
Merge branch '4.x' into upstream-master 2022-02-11 03:51:48 +02:00
Matthew Brown
6d057669fc
Fix #6683 by improving simplification of CNF (#7631) 2022-02-10 19:37:42 -05:00
Matthew Brown
b49b5f1c20 Make error message for truthy/falsy more accurate 2022-02-10 18:46:22 -05:00
Matthew Brown
547f11ebd9 Fix signature 2022-02-10 18:35:50 -05:00
Matthew Brown
c885dbcbe0 Prevent duplicate type comparison errors 2022-02-10 01:04:14 -05:00
Matthew Brown
2eca28c912 Remove more unused code from LoopAnalyzer 2022-02-09 16:37:15 -05:00
Bruce Weirdan
21e6371ce2
Strip colours from success message
Fixes vimeo/psalm#7619
2022-02-09 15:35:40 +02:00
Matthew Brown
457abc6e13 Don’t subtract int from array-key if not equality 2022-02-08 11:24:05 -05:00
Matthew Brown
13824d5a33 Fix awkward workaround for loop assignment map 2022-02-08 10:59:29 -05:00
AndrolGenhald
5b469ca577 Fix crash when assigning reference to unknown array offset. 2022-02-04 08:32:35 -06:00
AndrolGenhald
588d9e08bc Fix extension capitalization issue, add extensions to version message. 2022-02-03 11:34:50 -06:00
Vincent
3c3e692e7e AtomicStaticCallAnalyzer: clear tmp var from context (fix #7556) 2022-02-02 13:51:54 +01:00
Bruce Weirdan
dadb1f2167
Merge pull request #7539 from vimeo/revert-7363-81_returntypewillchange 2022-02-01 01:03:09 +02:00
Bruce Weirdan
f61193b798
Reinstate MethodSignatureMustProvideReturnType
It's never emitted, but is there for BC.
2022-01-31 23:38:15 +02:00
orklah
68e67aeb10
Merge pull request #7546 from orklah/impure-callable
Handle first class callable on unknown functions
2022-01-31 22:02:35 +01:00
orklah
5a19d42dab fix test 2022-01-31 21:51:31 +01:00
orklah
2e01e9b7cd
Merge pull request #7396 from Patrick-Remy/feat/key-of-value-of-improvements
feat: make key-of/value-of usable with non-const arrays
2022-01-31 21:39:01 +01:00
orklah
a598efb4ab Handle first class callable on unknown functions 2022-01-31 21:36:01 +01:00
adrew
121a801616 Fix object constant inference 2022-01-31 23:03:34 +03:00
Patrick Remy
51d4bf556a
fix: replace template args in key-of/value-of
Extend TTemplateKeyOf from Atomic instead of Scalar, to ensure it is
only compared in AtomicTypeComparator to reduce duplicate code.
2022-01-31 20:53:36 +01:00
orklah
fc281672ea fix wrong detection of purity 2022-01-31 20:52:25 +01:00
Bruce Weirdan
603714518b
Revert "PHP 8.1: Report missing typehints in overridden native methods" 2022-01-31 14:37:42 +02:00
6f51b4a432
Fix tests 2022-01-31 10:28:47 +01:00
52872c05a8
Fixes 2022-01-31 10:06:32 +01:00
8d0c1c62e8
Ensure all template parameters are specified in classes, interfaces, traits 2022-01-31 10:06:31 +01:00
Bruce Weirdan
997592de64
Merge pull request #7530 from ohader/issue-7528 2022-01-31 10:36:47 +02:00
Bruce Weirdan
0cbcd0fcf9
Fixed ExceptionCodeTest provider to emit array keys 2022-01-31 00:26:23 +02:00
Bruce Weirdan
a2977a5ca9
Merge branch '4.x' into upstream-master 2022-01-31 00:16:27 +02:00
Oliver Hader
e3602bbfe1
[FEATURE] Allow to intercept adding issue in IssueBuffer
This change introduces new `BeforeAddIssueEvent` which is invoked
from `IssueBuffer::add`, which allows to collect and intercept code
issue in a generic way.

Resolves: #7528
2022-01-30 17:46:08 +01:00
orklah
f93bd10c61
Merge pull request #7517 from orklah/fixEmptyArray
Fix empty array
2022-01-30 16:14:24 +01:00
orklah
0592c03cda fix issues resulting from previous commit 2022-01-30 16:05:38 +01:00
Vincent Langlet
584344fda3 Failing test 2022-01-30 15:17:18 +01:00
Oliver Hader
62a0ece035
!!! Allow plugins to modify Config::$fileExtensions early
ProjectAnalyzer consumed Config::$fileExtensions early in its
constructor - without having processed plugins' modifications,
registering their custom scanners or analyzer implementations.

This change
* adds new specific interface \Psalm\Plugin\FileExtensionsInterface
  to be used by plugin implementations
* extracts file extension handling from \Psalm\PluginRegistrationSocket
  and interface \Psalm\Plugin\RegistrationInterface to a new dedicated
  \Psalm\PluginFileExtensionsSocket and new interface
  \Psalm\Plugin\FileExtensionsInterface
  !!! this is a breaking change in PluginRegistrationSocket !!!
* adds runtime in-memory cache for Config::$plugins
* calls new method Config::processPluginFileExtensions(), providing
  modifications to file extension only early in ProjectAnalyzer
* adjusts documentation
2022-01-30 13:06:00 +01:00
orklah
1220320e0b
fix some iterator stubs (#6970)
* fix some iterator stubs

* fix iterators

* update stubs

* fix a test

* fixes

* fixes

* fix a test

* fix
2022-01-30 01:18:05 +01:00
Matthew Brown
faaf7690f6
Remove mic-drop hack from if analysis (#7484)
* Remove mic-drop hack from if analysis

* Remove more special handling

* Remove some unnecessary ElseAnalyzer code

* Add back necessary code

* Fix return type of method never returning null

* Add a comment

* Simplify && handling

* Add comments to make stuff clearer

* Move if-specfic logic to more appropriate setting
2022-01-28 18:30:47 -05:00
orklah
048025b1d6
Merge pull request #7511 from orklah/literal-inequality
improve literal inequality with ranges and rework GreaterThan/LessThan assertions
2022-01-28 22:27:09 +01:00
orklah
3b73654db7 handle literal inequality with ints 2022-01-28 21:59:30 +01:00
orklah
4609bc4e25
Merge pull request #7471 from klimick/function-dynamic-storage-provider
Function dynamic storage provider
2022-01-28 18:46:26 +01:00
orklah
2966f1c9d4
Merge pull request #7107 from AndrolGenhald/feature/5482-load-extensions-based-on-composer-config
Enable extensions based on composer.json instead of those loaded at runtime (fixes #5482).
2022-01-28 18:45:52 +01:00
AndrolGenhald
b473d812aa Fix side effect when loading config. 2022-01-28 09:26:58 -06:00
adrew
70cea447c8 Fix CS 2022-01-28 15:18:30 +03:00
adrew
dd0e00e153 Renaming all occurrences of "function dynamic storage" to "dynamic function storage" 2022-01-28 15:18:30 +03:00
adrew
e5dae6a901 Prevent first-class-callable handling with FunctionDynamicStorageProvider 2022-01-28 15:18:30 +03:00
adrew
9b383a5a19 Try to create public api for new hook 2022-01-28 15:18:30 +03:00
adrew
aefe971b90 Fix template creation in ArrayMapStorageProvider 2022-01-28 15:18:30 +03:00
adrew
ce1cec5d3a Using FuncCall instead of list<Arg> in FunctionDynamicStorageProvider for more flexibility 2022-01-28 15:18:30 +03:00
adrew
3210aab278 Test for FunctionDynamicStorageProvider 2022-01-28 15:18:29 +03:00
AndrolGenhald
282518ce5f Fix failing case in ClassConstAnalyzer and add test. 2022-01-27 21:50:36 -06:00
Patrick Remy
51cab704c4
fix: key-of/value-of handle nested template params 2022-01-28 00:04:21 +01:00