1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-05 21:19:03 +01:00
Commit Graph

7913 Commits

Author SHA1 Message Date
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
asrar
e3f46d9a3c refactor: use list<string> 2022-05-23 19:45:33 +02:00
asrar
e28831dff8 feat: fix ci + preserve existing throws 2022-05-22 18:27:38 +02:00
asrar
c6854cf567 Adds support for fixing missing throws doc block 2022-05-21 17:39:51 +02:00
Jerome TAMARELLE
afed93b6bd Fix conflict of option -c with shell completion 2022-05-20 09:42:57 +02:00
Kevin van Sonsbeek
22080a1b15 bugfix/#7912: Added extension_loaded check for apcu and load internal stub on true 2022-05-17 23:45:42 +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
Theodore Brown
6f3ceea7d0 Remove several unused use statements 2022-05-08 23:18:18 -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
Vincent Langlet
3729c0d3ed Sort types when intersection is used 2022-04-02 22:08:44 +02:00
Thomas Landauer
e87c25c825 Second attempt of #7835 2022-04-02 14:57:56 +02:00
Michael Stilkerich
a696e559b7 Treat readline functions as impure 2022-04-01 16:13:55 +02:00
AndrolGenhald
0bdf9425e3 Fix namespaced min/max int range keyword issue introduced in #7775. 2022-03-30 16:08:14 -05:00
orklah
80f972cc38
Merge pull request #7791 from ohader/issue-7771-4x
Avoid json_encode when serializing non-UTF8 literals
2022-03-16 19:00:49 +01:00
orklah
ebffd5258a
Merge pull request #7433 from zoonru/maximum_shaped_array_size
Add configuration for maximum size of shaped array
2022-03-15 21:19:05 +01:00
Oliver Hader
2b3753676b
Avoid json_encode when serializing non-UTF8 literals
`\Psalm\Internal\Clause::$hash` basically holds a hash on
arbitrary input literals, used for later comparison. Using
`json_encode` fails when dealing with non-UTF8 literals,
which has been replaced by plain PHP `serialize`.

Resolves: #7771
2022-03-15 10:39:58 +01:00
orklah
32f10c392d
Merge pull request #7788 from AndrolGenhald/attribute-analysis-improvements
More attribute fixes.
2022-03-14 21:11:19 +01:00
AndrolGenhald
11f51f4c54 Use key-of instead of literal int union. 2022-03-14 15:05:33 -05:00
AndrolGenhald
08d4d797ef More attribute fixes. 2022-03-14 14:15:07 -05:00
fluffycondor
7240f01154
Code style 2022-03-11 23:02:11 +00:00
fluffycondor
cb5231463c
Make error message more verbose 2022-03-11 22:58:41 +00:00
fluffycondor
6bc90fa0a9
Fix error messages 2022-03-11 22:54:30 +00:00
Semyon
9beb0a62b2 Forbid min bound greater than max bound in int range 2022-03-11 17:26:59 +03:00
Semyon
a7e98f4bfc Forbid any non literal int in int range (except min and max named objects) 2022-03-11 17:26:07 +03:00
Matthew Brown
2a9ea7ea71 Support Stringable before PhpToken autoloading 2022-03-07 16:08:24 -05:00
Mateusz Cholewka
483d35980a check is value for sure is null 2022-03-07 14:07:16 +01:00
Mateusz Cholewka
d53f57b5f7 wrap row in union again
From: https://github.com/vimeo/psalm/pull/7760#discussion_r820264671

$result_element_type should be a Union, $row_shape is an Atomic
(a part of a Union). new Union([$row_shape]); should be ok
2022-03-06 21:28:48 +01:00
Mateusz Cholewka
56e65fd5ba skip creating unnecessary union 2022-03-06 17:07:56 +01:00
Mateusz Cholewka
88d49b9923 provide array column type for null column 2022-03-06 15:44:56 +01:00
Abdul Malik Ikhsan
9666b90e41
Register openssl_sign function to impure functions
openssl_sign has $signature parameter that by reference that can re-used
2022-03-02 22:59:12 +07:00
orklah
fc2c6ab4d5
Merge pull request #7727 from AndrolGenhald/attribute-analysis-improvements
Attribute analysis improvements
2022-02-24 21:34:05 +01:00
orklah
26bfc95b13 allow SimpleTypeInferer to infer non empty lists 2022-02-24 20:57:29 +01:00
AndrolGenhald
c82abe3017 Fix trailing commas for PHP 7. 2022-02-23 22:30:50 -06:00
AndrolGenhald
5f9a8c9240 Fix types. 2022-02-23 22:12:32 -06:00
AndrolGenhald
43764f0c3d Add Reflection getAttributes analysis. 2022-02-23 22:12:32 -06:00
AndrolGenhald
1387f94324 Attribute analysis improvements. 2022-02-23 22:12:32 -06:00
orklah
3a85f49268
Merge pull request #7673 from VincentLanglet/pdoException
PDOException extends RuntimeException and can use int code errors
2022-02-23 13:45:57 +01:00
Bei Xiao
c9666bbeb5 Reduce method complexity 2022-02-22 20:50:43 +02:00
Bei Xiao
6a3b5679fe Support interfaces extending enums 2022-02-22 16:04:56 +02:00
Aaron Piotrowski
97b5685f55
Fix first-class callable in loop 2022-02-21 18:37:20 -06:00
orklah
1a5b120081
Merge pull request #7713 from AndrolGenhald/bugfix/self-in-attribute
Use current context when analyzing attributes
2022-02-21 18:50:22 +01:00
AndrolGenhald
04c0db5aff Use current context when analyzing attributes (fixes #7710). 2022-02-21 10:38:50 -06:00
m1ke
628bf584c2 Alter config file to actually load threads param 2022-02-21 11:07:21 +00:00
AndrolGenhald
0476ca7844 Fix trailing commas for PHP < 7.3. 2022-02-18 08:44:51 -06:00
AndrolGenhald
ea2f452c25 Analyze attribute statements instead of constructing virtual statements. 2022-02-18 08:18:34 -06:00
a.dmitryuk
8e1e0d1e5e style-ci 2022-02-18 10:33:35 +07:00
a.dmitryuk
dc8764153e Throw exception if file_put_contents failed 2022-02-18 10:05:23 +07:00
87d9a01f78 Add configuration for maximum size of shaped array 2022-02-15 14:09:08 +01:00
eb3df40fbb
Add option to disable @var parsing everywhere except for properties. 2022-02-15 10:04:56 +01:00
Vincent Langlet
694157b2e0 PDOException extends RuntimeException and can use int code errors 2022-02-14 21:04:10 +01:00
AndrolGenhald
fd0ecf2528 Rename variable to be consistent with existing convention. 2022-02-13 15:34:21 -06:00
AndrolGenhald
32c389482c Fix issue with nested try block and add more tests. 2022-02-13 15:30:06 -06:00
AndrolGenhald
7b1599d783 Fix false positive for unused variable in try (fixes #7613). 2022-02-13 15:14:59 -06:00
Bruce Weirdan
dc776d3ada
Suppress false-positive 2022-02-13 00:48:58 +02:00
Bruce Weirdan
45a19b3f3c
Honour global function suppressions for UndefinedFunction
Fixes vimeo/psalm#7610
2022-02-13 00:22:55 +02:00
orklah
a3852b8a55
Merge pull request #7650 from orklah/totallytyped
deprecate totallyTyped
2022-02-12 09:56:39 +01:00
orklah
dbf47b16c3 deprecate totallyTyped 2022-02-12 09:30:37 +01:00
orklah
c13a536386
Merge pull request #7614 from kkmuffme/add-phpredis-stubs
add phpredis stubs
2022-02-11 23:15:48 +01:00
m1ke
92aedd6f7f Fix cherry pick issues 2022-02-11 11:27:01 +00:00
m1ke
fc694d7a98 Allow psalm to load threads from the config 2022-02-11 11:23:17 +00:00
m1ke
a688bd6da3 Use config threads if lower than detected threads 2022-02-11 11:23:09 +00:00
m1ke
810880c71b Alter order of precedence and upated docs to match 2022-02-11 11:12:36 +00:00
Office
432d0be658 load phpredis stubs 2022-02-09 15:56:51 +01:00
Bruce Weirdan
21e6371ce2
Strip colours from success message
Fixes vimeo/psalm#7619
2022-02-09 15:35:40 +02:00
Tomasz Kusy
124aa22fe9 Resolve __DIR__ / __FILE__ when const/variable is used for include CS fix fix fix :) 2022-02-04 20:27:45 +01:00
Tomasz Kusy
8da45aa7d8 Resolve __DIR__ / __FILE__ when const/variable is used for include CS fix fix 2022-02-04 20:26:06 +01:00
Tomasz Kusy
b73f2c96d8 Resolve __DIR__ / __FILE__ when const/variable is used for include CS fix 2022-02-04 19:43:55 +01:00
Tomasz Kusy
bcbfbed072 Resolve __DIR__ / __FILE__ when const/variable is used for include 2022-02-04 19:39:39 +01:00
phptest2
582624a932
improving error message for Could not resolve config path
$directory_path is false, so better use $prospective_directory_path in the error message.
2022-02-03 17:58:12 +01:00
Vincent
3c3e692e7e AtomicStaticCallAnalyzer: clear tmp var from context (fix #7556) 2022-02-02 13:51:54 +01:00
orklah
1c2ffc81c2 tweaks 2022-02-01 22:49:20 +01:00
Bruce Weirdan
dadb1f2167
Merge pull request #7539 from vimeo/revert-7363-81_returntypewillchange 2022-02-01 01:03:09 +02:00
Bruce Weirdan
f61193b798
Reinstate MethodSignatureMustProvideReturnType
It's never emitted, but is there for BC.
2022-01-31 23:38:15 +02:00
orklah
68e67aeb10
Merge pull request #7546 from orklah/impure-callable
Handle first class callable on unknown functions
2022-01-31 22:02:35 +01:00
orklah
a598efb4ab Handle first class callable on unknown functions 2022-01-31 21:36:01 +01:00
adrew
e284b91b82 Remove redundant flag from SimpleTypeInferer 2022-01-31 23:03:34 +03:00
adrew
121a801616 Fix object constant inference 2022-01-31 23:03:34 +03:00
orklah
48e09ab308 fix 2022-01-31 20:55:53 +01:00
orklah
fc281672ea fix wrong detection of purity 2022-01-31 20:52:25 +01:00
Bruce Weirdan
603714518b
Revert "PHP 8.1: Report missing typehints in overridden native methods" 2022-01-31 14:37:42 +02: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
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
b30121ba1c
Deprecate template_extended_count 2022-01-26 20:21:00 +01:00
orklah
3f799fc5fd fix CS issue 2022-01-25 20:58:40 +01:00
ElisDN
9f01c16ae9 Fix array_replace type 2022-01-25 15:22:50 +03:00