Teemu Koskinen
fefd4861d6
Use $codebase->classlike_storage_provider only if it has the required data. Fixes #8373
2022-08-08 23:49:14 +03:00
kkmuffme
0d32203f9a
add ", but" for InvalidArgument error message where a type is provided
2022-08-03 19:40:30 +02:00
AndrolGenhald
148264305f
Merge pull request #8341 from someniatko/issue-7731
...
recognize `@psalm-allow-private-mutation` in PHP 8+ constructors
2022-07-29 09:31:20 -05:00
someniatko
0abde258fa
#7731 - recognize @psalm-allow-private-mutation
in PHP 8+ constructors
2022-07-29 16:50:56 +03:00
someniatko
0c652f72f6
#8330 - take into account that static
type may have been unwrapped in ExistingAtomicStaticCallAnalyzer#hasStaticInType()
2022-07-29 12:31:37 +03:00
orklah
d7cd84c4eb
Merge pull request #8302 from kkmuffme/fix-cache-directory-race-conditions
...
fix race conditions causing notices if directory does not exist
2022-07-25 19:04:37 +02:00
Semyon
b1295d6894
Code style
2022-07-25 17:15:28 +03:00
kkmuffme
e1b0255db8
fix triggerErrorExits not working
...
Fix https://github.com/vimeo/psalm/issues/8270
2022-07-21 12:54:47 +02:00
kkmuffme
233863dc0c
circle CI error for unrelated code?
2022-07-21 11:36:55 +02:00
kkmuffme
bb760a2224
fix race conditions causing notices if directory does not exist
2022-07-21 11:36:16 +02:00
AndrolGenhald
cac9ec957c
Merge pull request #8249 from someniatko/issue-8200
...
Improve inferring the "final" `static` type when calling static methods inside a different class
2022-07-14 16:41:01 -05:00
orklah
416b597d1c
Merge pull request #7994 from aszenz/4.x
...
Adds support for fixing missing throws doc block
2022-07-12 20:46:14 +02:00
someniatko
931b3bb18b
#8200 - simplify ExistingAtomicStaticCallAnalyzer::hasStaticType()
2022-07-12 21:43:31 +03:00
someniatko
b3e673d7ec
#8200 - flip logic of determining "source" of static
type in ExistingAtomicStaticCallAnalyzer::getMethodReturnType()
2022-07-12 21:17:10 +03:00
someniatko
3a5054018b
#8200 - generalize ExistingAtomicStaticCallAnalyzer::hasStaticInType() for non-object cases
2022-07-12 21:00:19 +03:00
someniatko
470885e4f1
#8200 - improve inferring the "final" static
type when calling static methods inside a different class
...
differentiate between `static` defined in a class which CALLS a given static method, and `static` defined in the method which IS CALLED.
2022-07-12 13:51:28 +03:00
orklah
7f3d55dfa0
Merge pull request #8244 from jack-worman/CountReport
...
New "Count" Report Format
2022-07-11 18:55:01 +02:00
Jack Worman
3b76ac85dc
Count Report Format
2022-07-10 17:50:50 -05:00
kkmuffme
a77f6fca12
use error_log
2022-07-10 12:04:42 +02:00
kkmuffme
7742d8a903
use lock to fix race condition
2022-07-10 10:03:18 +02:00
kkmuffme
90586083e6
check if file in cache already before adding
...
* reduces I/O by 30%
* minimal performance improvement (<0.5%)
2022-06-28 20:46:23 +02:00
kkmuffme
9082eab915
improve cache hash performance
...
* do not concatenate with timestamp as this is slow, since $file_contents may be big
* use file contents not file path for cache hash only to ensure it works if file_path not set but file_content is
* improves performance by ~5%
2022-06-28 20:45:03 +02:00
kkmuffme
57239a7c8e
assign keys to variable for better performance
...
improves performance by ~1-1.5%
2022-06-28 20:40:43 +02:00
kkmuffme
4048bb9d8b
only sort when necessary and faster hash
...
* sort is much more expensive than count, so we only sort if we have something to sort
* could implement for ksort too, but advantage there is minimal since we almost always have more than 1 possibility
* use same hash algorithm as in other places (= faster)
* reduces runtime by 2-3%
2022-06-28 20:40:43 +02:00
kkmuffme
4db928e923
split loop for better performance
...
* check isset for all elements first, as array_diff is much more expensive
* Improves performance by 1%
2022-06-28 20:40:43 +02:00
Tim Düsterhus
31ad16d29c
Stop using deprecated string interpolation syntax in StatementsProvider.php
...
This fixed the following PHP 8.2 deprecation:
> Uncaught RuntimeException: PHP Error: Using ${var} in strings is deprecated, use {$var} instead in …/vimeo/psalm/src/Psalm/Internal/Provider/StatementsProvider.php:140
see: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
2022-06-27 23:41:51 +02:00
orklah
06dd975cb5
Merge pull request #8174 from AndrolGenhald/fix-attribute-crash
...
Fix crash when redefining method with fewer params (fixes #8141 ).
2022-06-26 13:47:54 +02:00
AndrolGenhald
e751a27eaf
Fix crash when redefining method with fewer params ( fixes #8141 ).
2022-06-26 06:27:46 -05:00
orklah
b3038f0936
Merge pull request #8164 from AndrolGenhald/encapsed-literal-strings
...
Encapsed literal strings
2022-06-26 12:52:33 +02:00
orklah
a4ab664aee
Merge pull request #8165 from AndrolGenhald/stop-using-issuebuffer-add- 😡
...
Improve @psalm-internal and prevent usage of IssueBuffer::add().
2022-06-25 10:12:10 +02:00
AndrolGenhald
b671117417
Improve @psalm-internal and prevent usage of IssueBuffer::add().
2022-06-25 02:09:40 -05:00
AndrolGenhald
5ff54bce46
CS fix.
2022-06-24 21:03:33 -05:00
AndrolGenhald
3aea0987ef
Fix non-empty encapsed string check.
2022-06-24 20:28:04 -05:00
AndrolGenhald
a804e459b6
PHP 7.1 compatibility.
2022-06-24 19:29:12 -05:00
AndrolGenhald
2559222f67
More interpolation and concatenation improvements.
2022-06-24 19:22:59 -05:00
AndrolGenhald
450409f045
Infer literal string from encapsed (interpolated) string.
2022-06-24 17:24:34 -05:00
Benjamin Morel
933714f6ad
Add ReflectionProperty properties
2022-06-24 18:47:49 +02:00
orklah
c60e0a890c
Merge pull request #8056 from kkmuffme/phpdoc-false-positives-for-partially-invalid
...
fix false positives for partially invalid phpdoc
2022-06-15 13:21:26 +02:00
orklah
02d5beecb0
Merge pull request #8051 from AndrolGenhald/bugfix/8048
...
Fix possibly empty array shape appearing non-empty (fixes #8048 ).
2022-06-08 19:22:12 +02:00
AndrolGenhald
af5c191e7b
Fix generic object comparison to use template constraint as default ( fixes #8068 ).
2022-06-07 19:12:36 -05:00
Bruce Weirdan
4e59398f77
Coerce null to empty string in array keys
...
Fixes vimeo/psalm#8063
Alters the fix for vimeo/psalm#2165 (1a48be8e9c
)
/cc: @iluuu1994, @muglug
2022-06-06 17:41:42 -04:00
AndrolGenhald
34322b79dd
Fix suppression comment.
2022-06-06 16:19:27 -05:00
kkmuffme
74671e3a3c
fix false positives for partially incalid phpdoc
2022-06-05 12:16:01 +02:00
orklah
f47b4180fb
Merge pull request #8054 from kkmuffme/runtime-cache-origin-location
...
store origin location by ID to speed up psalm by up to 75%
2022-06-04 18:47:14 +02:00
kkmuffme
cb78f54d8a
Performance: cut the selected_text from snippet
...
instead of from full text
50% faster than cutting from full text, improves performance up to 3% depending on file length and number of errors in file
2022-06-04 15:53:02 +02:00
kkmuffme
8b20708063
stores origin location by ID to speed up psalm by up to 75% in certain cases
2022-06-04 14:26:27 +02:00
AndrolGenhald
c271b1245e
Fix possibly empty array shape appearing non-empty ( fixes #8048 ).
2022-06-02 14:00:52 -05:00
AndrolGenhald
2f090e5722
Fix TypeCombiner::combine
to not modify TIntRange arguments.
...
This keeps coming up in obscure places, hopefully this fixes it once and for all. I would reeeaaally love to have an immutable type system at some point...
2022-06-02 12:36:41 -05:00
AndrolGenhald
054ed300f0
Fix side effect when loading config.
2022-05-29 00:16:38 -04:00
orklah
06d8e3e399
Merge pull request #8011 from kkmuffme/performance-only-load-files-once
...
Performance only load files once
2022-05-26 18:03:08 +02:00