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
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
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
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
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
orklah
d94f56a88a
Merge pull request #8007 from kkmuffme/add-missing-igbinary-serialize-code
...
igbinary_serialize code was missing in file
2022-05-26 17:57:02 +02:00
kkmuffme
278e8777d9
dont strolower filename, since file names on linux are case sensitive
2022-05-25 14:12:15 +02:00
kkmuffme
06178d0a6b
only load files once
...
* use static to keep opened files with content
* move position of file cache population to the place where we read files to ensure cache always gets populated and not on open only (since it's called directly in some places)
2022-05-25 13:53:32 +02:00
kkmuffme
5d8b5d197d
micro-optimize condition
...
https://github.com/vimeo/psalm/pull/7997#pullrequestreview-983975049
2022-05-25 11:25:19 +02:00
kkmuffme
ed0db0f7ce
igbinary_serialize code was missing in file
2022-05-25 10:52:41 +02:00
kkmuffme
acffb851f6
debug CI
2022-05-24 10:00:54 +02:00
kkmuffme
c1cef60e21
change cache hash type for better performance
2022-05-24 09:59:47 +02:00
Jerome TAMARELLE
afed93b6bd
Fix conflict of option -c with shell completion
2022-05-20 09:42:57 +02:00
Theodore Brown
4eef964048
Infer object shape when array or scalar is cast to object
...
Also detect redundant object casts.
Fixes #7916 , fixes #7934
2022-05-09 20:31:29 -05:00
Matt Brown
9c153de6da
Fix LSP api discrepancies
2022-04-27 11:56:54 -04:00
orklah
038947eb08
Merge pull request #7887 from ging-dev/lsp-fixes
...
improve LSP
2022-04-26 22:23:00 +02:00
m1ke
70b44d566f
Alter order of baseline option operations to allow updating custom baseline
2022-04-26 14:35:33 +01:00
ging-dev
cb10e845e0
improve LSP
2022-04-25 17:43:23 +07:00
orklah
2724c1dba9
Merge pull request #7872 from hirokinoue/float-template-arithmetics-4.x
...
don't emit issues when doing arithmetics on float templates
2022-04-19 19:35:57 +02:00
Vitaliy Ognev
6afdb0d9b6
better type safety and inference
2022-04-18 21:00:20 +03:00
Vitaliy Ognev
1dc2b3b026
cache statements even without persistent parser cache
2022-04-18 10:26:56 +03:00
hirokinoue
b132c3b751
fix error message
2022-04-16 14:05:40 +09:00
hirokinoue
a99532da5e
code format
2022-04-16 14:05:31 +09:00
hirokinoue
23c3d87dcc
don't emit issues when doing arithmetics on float templates
2022-04-16 14:05:20 +09:00
Anton Belyaev
e7c2c77ec2
Disable filepath formatting as a link for Drone CI's output
2022-04-11 23:19:55 +03:00
orklah
6d0cc07255
Merge pull request #7838 from VincentLanglet/sortTypes
...
Fix Incompatible types found for T (Stub&ProxyQueryInterface is not in ProxyQueryInterface&Stub)
2022-04-10 10:20:30 +02:00
Thomas Landauer
587039fd1d
Fixing CS
2022-04-03 11:41:39 +02:00
Vincent Langlet
590ac22ea2
Use another strategy
2022-04-03 09:16:00 +02:00