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
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
AndrolGenhald
c2b44ff073
Fix copy/paste fail and other psalm/cs issues, reduce duplication of literals.
2022-01-27 16:31:09 -06:00
AndrolGenhald
8132b57881
Add XML config options to enable/disable PHP extensions.
2022-01-27 16:31:05 -06:00
AndrolGenhald
2fe4fc397c
Enable extensions based on composer.json instead of those loaded at runtime ( fixes #5482 ).
2022-01-27 16:30:14 -06:00
orklah
9168cef2d4
Merge remote-tracking branch 'upstream/4.x' into upstream-master6
2022-01-26 21:06:25 +01:00
Matthew Brown
ac29afcfe4
Don’t expect config exception in test
2022-01-26 14:30:01 -05:00
AndrolGenhald
740a10141d
Fix crash when a reference is reassigned in a loop.
2022-01-26 12:56:17 -06:00
AndrolGenhald
57b99be519
Improve reference support for assertions, array offsets, and properties.
2022-01-26 12:55:47 -06:00
AndrolGenhald
089700d1be
Add more reference tests.
2022-01-26 12:55:47 -06:00
AndrolGenhald
3c7d176f87
Minor CS fix, phrasing improvement, fix test.
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
AndrolGenhald
b68c6116d8
Use PHP 8.1 when testing AmbiguousConstantInheritance.
2022-01-25 15:49:09 -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
204d09b271
fix error with 0 being considered positive
2022-01-25 21:54:55 +01: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
ElisDN
9f01c16ae9
Fix array_replace type
2022-01-25 15:22:50 +03:00
Matthew Brown
8ab0eec4dd
Fix key
2022-01-25 01:36:23 -05:00
Matthew Brown
302c72d5b1
Add a couple of currently-working tests
2022-01-25 01:32:35 -05:00
Matthew Brown
c974f23852
Simplify context references
2022-01-24 16:35:42 -05:00
Matthew Brown
61d450a267
Fix combination of templated types
2022-01-24 13:56:32 -05:00
Matthew Brown
944b281cbe
Prevent negation from removing unmatched template vars
2022-01-24 13:20:02 -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
280de4bc98
Fix undefined parent method call (ref #7414 )
2022-01-24 09:17:29 +01:00
orklah
63b802bff4
remove TPositiveInt
2022-01-23 23:49:23 +01:00
orklah
7c4f08067b
Merge remote-tracking branch 'upstream/4.x' into upstream-master5
2022-01-23 23:44:04 +01:00
orklah
a7b72b865f
remove TPositiveInt usage for TIntRange
2022-01-23 22:04:18 +01:00
orklah
82d84b0b3a
fix internal properties on interfaces
2022-01-23 13:08:35 +01:00
AndrolGenhald
7d256975e4
Fix cs/psalm errors after rebase.
2022-01-22 17:06:54 -06:00
AndrolGenhald
1686f28a37
Default to using inferred type unless in late static binding context.
2022-01-22 17:06:54 -06:00
AndrolGenhald
0fb0632e0d
Infer type from known ternary condition.
2022-01-22 17:06:54 -06:00
AndrolGenhald
558208e44e
Add type checking for class const assignments, fix several other const issues.
2022-01-22 17:06:54 -06:00