1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 17:57:37 +01:00
Commit Graph

3142 Commits

Author SHA1 Message Date
Matthew Brown
48b702b76a Remove some unnecessary code 2022-02-08 17:12:18 -05:00
Matthew Brown
e130dd9b1c Fix too-long line 2022-02-08 16:28:21 -05:00
Matthew Brown
e35e6fe992 Improve naming of variables 2022-02-08 16:25:33 -05:00
Matthew Brown
13824d5a33 Fix awkward workaround for loop assignment map 2022-02-08 10:59:29 -05:00
Matthew Brown
3a298d028e Rename getArrayVarId to getExtendedVarId 2022-02-04 12:49:12 -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
Matthew Brown
8098755ce5 Remove comma 2022-02-02 11:29:31 -05:00
Matthew Brown
b382d7db3c Remove some unnecessary code around taint analysis 2022-02-02 11:25:03 -05:00
Matthew Brown
2b81990259 Simplify var naming 2022-02-02 11:25:02 -05:00
Matthew Brown
fcfd4d30f3 Simplify passing in template result for calls 2022-01-31 09:36:40 -05:00
ada778e8df
Remove unused field 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
b51cb75f76
Merge pull request #7535 from ohader/issue-7534 2022-01-31 10:34:57 +02:00
Bruce Weirdan
a2977a5ca9
Merge branch '4.x' into upstream-master 2022-01-31 00:16:27 +02:00
Oliver Hader
f5986950a2
[FEATURE] Introduce BeforeStatementAnalysisEvent
As counterpart to existing `AfterStatementAnalysisEvent` - invoked in
`\Psalm\Internal\Analyzer\StatementsAnalyzer` - this changed introcued
a corresponding `BeforeStatementAnalysisEvent`.

Resolves: #7534
2022-01-30 19:27:19 +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
orklah
5a3735b90a Change code so it handles what it was designed for 2022-01-30 16:05:22 +01:00
Vincent Langlet
854a3412fe Use function 2022-01-30 15:32:55 +01:00
Vincent Langlet
cd3213201d Fix 2022-01-30 15:30:40 +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
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
adrew
3c22ecfa98 Remove args pre-analysis before run params provider hook 2022-01-28 15:18:30 +03:00
adrew
89c6a70dda Simplify dynamic storage handling in FunctionCallAnalyzer 2022-01-28 15:18:30 +03:00
adrew
a4e56ae288 Fix method name 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
438be03414 Ability to provide dynamically created function storage via plugin hook 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
AndrolGenhald
35353c6931 Re-add failing assert, enable assertions on CI. 2022-01-27 21:29:43 -06:00
Matthew Brown
1a6f968e15 Remove dodgy assertion cc @AndrolGenhald
This assertion broke tests when assertions were turned on
2022-01-27 20:58:35 -05:00
orklah
9168cef2d4 Merge remote-tracking branch 'upstream/4.x' into upstream-master6 2022-01-26 21:06:25 +01:00
AndrolGenhald
e268a05307 Minor fixes after rebasing. 2022-01-26 12:57:19 -06:00
AndrolGenhald
57b99be519 Improve reference support for assertions, array offsets, and properties. 2022-01-26 12:55:47 -06:00
AndrolGenhald
bf606202f8 Remove impossible TODO. 2022-01-26 12:55:47 -06:00
AndrolGenhald
f9450656e1 Add support for references and improve UnusedVariable checks (fixes #7254). 2022-01-26 12:55:47 -06:00
orklah
66343dee7b
Merge pull request #7154 from AndrolGenhald/feature/class-const-improvements
Improve class constant static analysis
2022-01-26 19:44:26 +01:00
AndrolGenhald
ba8234dd2c Fix crash due to unresolvable constant. 2022-01-25 17:03:13 -06:00
AndrolGenhald
0b81f46bb1 Fixes after rebasing. 2022-01-25 15:31:09 -06:00
AndrolGenhald
0edf260d8b Improve class constant static analysis.
Add class const covariance support (fixes #5589).
Add check for overriding const from interface in PHP < 8.1 (fixes #7108).
Add check for ambiguous const inheritance.
2022-01-25 15:20:17 -06:00
orklah
7c8441baec
Merge pull request #7123 from AndrolGenhald/feature/942-type-annotate-class-constants
Support type annotations for class consts (fixes #942).
2022-01-25 20:54:40 +01:00
Matthew Brown
c974f23852 Simplify context references 2022-01-24 16:35:42 -05:00
Matthew Brown
18f5446924 Remove unnecessary hack embedding IfScope in Context object 2022-01-24 14:00:20 -05:00
Matthew Brown
c7d938bbbe Remove unnecessary code in Context::removeDescendants 2022-01-24 10:34:48 -05:00
orklah
f1c4b62f5c
Merge pull request #7414 from b2pweb/call-docblock-method-using-parent
Add support of docblock method using parent keyword
2022-01-24 13:02:57 +01:00
orklah
0619b404e5
Merge pull request #7390 from VincentLanglet/exceptionCode
Add Exception->getCode() return type provider
2022-01-24 12:56:57 +01:00
Vincent Langlet
9905baeceb Add flagfrom_calculation 2022-01-24 09:31:10 +01:00
Vincent
280de4bc98 Fix undefined parent method call (ref #7414) 2022-01-24 09:17:29 +01:00