orklah
84d9b5e10c
add back empty
2022-01-30 18:43:44 +01: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
4729eb004a
Merge pull request #7532 from ohader/event-nameing-4x
...
[TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage
2022-01-30 17:01:30 +01:00
Oliver Hader
1e072cb904
[TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage
...
AfterFunctionLikeAnalysisEvent's method `getClasslikeStorage` actually
returned the current `FunctionLikeStorage`. This change streamlines the
naming and adds corresponding `getFunctionlikeStorage` method.
Method `getClasslikeStorage` is deprecated in will be removed
in Psalm v5.0.
2022-01-30 16:55:39 +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
orklah
286176f9c3
Merge pull request #7525 from VincentLanglet/exceptionCode2
...
Fix for Exception->getCode return type provider
2022-01-30 15:42:26 +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
Vincent Langlet
584344fda3
Failing test
2022-01-30 15:17:18 +01:00
orklah
64d06c6566
Merge pull request #6789 from ohader/issue-6788
...
❗ Allow plugins to modify Config::$fileExtensions early
2022-01-30 13:17:12 +01:00
Oliver Hader
3fedb5cce6
Apply code styles
2022-01-30 13:06:02 +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
Bruce Weirdan
963b41d317
Merge branch '4.x' into upstream-master
2022-01-30 00:32:12 +02:00
Bruce Weirdan
b45306c8a5
Merge pull request #7522 from weirdan/update-attributes
2022-01-30 00:30:15 +02:00
Bruce Weirdan
c025d1eb21
Update .gitattributes
...
* Do not ship baseline and UPGRADING.md in dist packages
* Mark .phpstub as PHP to fix Github syntax highlighting
2022-01-30 00:23:28 +02: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
66ccf93109
fix CS
2022-01-28 22:21:30 +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
Bruce Weirdan
891479300e
Merge pull request #7506 from AndrolGenhald/bugfix/fix-side-effect-when-loading-config
2022-01-28 19:14:02 +02:00
AndrolGenhald
b473d812aa
Fix side effect when loading config.
2022-01-28 09:26:58 -06:00
Bruce Weirdan
b9d9a494e1
Merge pull request #7504 from mal-tee/ssrf_getimagesize
2022-01-28 15:51:46 +02:00
adrew
5b78125d11
Add doc for DynamicFunctionStorageProviderInterface
2022-01-28 15:18:30 +03:00
adrew
70cea447c8
Fix CS
2022-01-28 15:18:30 +03:00
adrew
1a8367a273
Add some doc about DynamicFunctionStorageProvider
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
de2257ecd3
Make ArgTypeInferer constructor internal
2022-01-28 15:18:30 +03:00
adrew
46f695993b
Make FunctionDynamicStorageProviderEvent final
2022-01-28 15:18:30 +03:00
adrew
693b295c01
Improve ArgTypeInferer
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
3c22ecfa98
Remove args pre-analysis before run params provider 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
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
e93c90bc89
Fix double run FunctionDynamicStorageProvider for already analysed function
2022-01-28 15:18:29 +03:00
adrew
ec9b2288cc
Fix CS
2022-01-28 15:18:29 +03:00
adrew
3210aab278
Test for FunctionDynamicStorageProvider
2022-01-28 15:18:29 +03:00
adrew
438be03414
Ability to provide dynamically created function storage via plugin hook
2022-01-28 15:18:29 +03:00
mal-tee
ee990ebff6
InternalTaintSinkMap: Add getimagesize as SSRF sink
2022-01-28 12:29:26 +01:00
orklah
47a254547a
Merge pull request #7503 from AndrolGenhald/bugfix/fix-const-analyzer-failing-assert
...
Fix failing case for const analyzer.
2022-01-28 07:13:19 +01: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