1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 17:57:37 +01:00
Commit Graph

281 Commits

Author SHA1 Message Date
3abd0b961f Immutable Unions 2022-10-03 10:45:36 +02:00
AndrolGenhald
285740a753 Merge branch '4.x' 2022-07-07 15:01:38 -05: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
AndrolGenhald
b671117417 Improve @psalm-internal and prevent usage of IssueBuffer::add(). 2022-06-25 02:09:40 -05:00
Matt Brown
20351c6667 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-04-27 01:42:37 -04:00
AndrolGenhald
08d4d797ef More attribute fixes. 2022-03-14 14:15:07 -05:00
orklah
0fe6eaf5d9 Merge remote-tracking branch 'upstream/4.x' into upstream-master13 2022-02-26 21:26:59 +01:00
AndrolGenhald
1387f94324 Attribute analysis improvements. 2022-02-23 22:12:32 -06:00
AndrolGenhald
04c0db5aff Use current context when analyzing attributes (fixes #7710). 2022-02-21 10:38:50 -06:00
Bruce Weirdan
997bded2e3
Merge branch '4.x' into upstream-master 2022-02-21 01:08:21 +02:00
AndrolGenhald
ea2f452c25 Analyze attribute statements instead of constructing virtual statements. 2022-02-18 08:18:34 -06:00
AndrolGenhald
f9450656e1 Add support for references and improve UnusedVariable checks (fixes #7254). 2022-01-26 12:55:47 -06:00
AndrolGenhald
ba8234dd2c Fix crash due to unresolvable constant. 2022-01-25 17:03:13 -06:00
AndrolGenhald
c18a155f77 Support type annotations for class consts (fixes #942). 2022-01-22 17:06:53 -06:00
orklah
b3e7f12933 Prevent NoValue when there is no phpdoc 2022-01-14 21:39:23 +01:00
orklah
b633619a2c Merge remote-tracking branch 'upstream/4.x' into upstream-master 2022-01-14 21:01:25 +01:00
Patrick Remy
a555543c0c
fix: pass static class name to ReturnTypeAnalyzer 2022-01-10 21:23:52 +01:00
Matthew Brown
a435bc57b9 Rename was_static property to is_static to be more accurate 2022-01-09 14:45:07 -05:00
orklah
cbb0c6398f allow short closure with never 2022-01-06 21:36:34 +01:00
orklah
bf4bf92cb2
Merge pull request #7313 from orklah/empty-arrays
replace `array<never, never>` as a way to detect empty arrays by a dedicated method
2022-01-05 23:58:45 +01:00
orklah
3c468b3eeb replace array<never, never> as a way to detect empty arrays by a dedicated method 2022-01-05 23:14:54 +01:00
Bruce Weirdan
5758d31161
Apply literal number separator rector
I opted for customary 3-digit groups, except version id, where 2-digit
groups are used to match the version id encoding.
2022-01-05 01:00:05 +02:00
Bruce Weirdan
966b6ae2b2
Merge pull request #6808 from orklah/exitFunctions3 2022-01-03 06:04:01 +02:00
orklah
0747b48d06
remove TEmpty 2022-01-03 04:09:59 +02:00
orklah
b658b2738f
remove exitFunctions 2022-01-02 15:20:01 +02:00
orklah
8d6b781b3e
use consistent way to compare php version 2022-01-02 13:35:43 +02:00
adrew
878dfa2250 Variable types inference in method context when method marked with psalm-if-this-is 2022-01-01 13:03:17 +03:00
orklah
5f6bb39888 if with common parts 2021-12-27 23:08:19 +01:00
rarila
97e6511fab Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
rarila
1c298c4605 Conversion of Psalm\Type 2021-12-14 02:31:22 +01:00
ralila
e32af3c05a Conversion of Psalm\Type\Atomic 2021-12-14 02:26:28 +01:00
orklah
f79f857ded
Merge pull request #7133 from AndrolGenhald/remove-unused-suppressed
Allow suppressing UnusedPsalmSuppress, remove unused suppressions.
2021-12-11 23:24:31 +01:00
AndrolGenhald
225af970cc Add comments explaining condition for UnusedPsalmSuppress. 2021-12-11 16:14:25 -06:00
AndrolGenhald
23b781163a Use getSingleAtomic() instead of array_values(getAtomicTypes())[0]. 2021-12-11 13:44:34 -06:00
AndrolGenhald
bfe7f96b56 Allow suppressing UnusedPsalmSuppress, remove unused suppressions. 2021-12-11 13:23:00 -06:00
rarila
39402c233d
Return type hints (#7065)
Co-authored-by: ralila <>
2021-12-05 19:51:26 +02:00
ralila
f833085a15 Fix fqn usage in php-doc 2021-12-04 03:37:19 +01:00
ralila
30a65685a2 Import instead of using fqn classes 2021-12-03 21:40:18 +01:00
ralila
2a956498bf Import instead of using fqn functions 2021-12-03 21:07:25 +01:00
ralila
245920e53c Import instead of using fqn 2021-12-03 20:11:20 +01:00
Matthew Brown
175ba83332
Migrate most IssueBuffer::accepts calls to IssueBuffer::maybeAdd (#7020) 2021-11-29 14:54:17 -05:00
orklah
ab61eae5c9 Taint can't transmit through numerics nor bool 2021-11-25 22:51:35 +01:00
orklah
3bc06a8eab Taint can't transmit through numerics nor bool 2021-11-25 22:40:01 +01:00
Bruce Weirdan
c556920352
Revert "Merge remote-tracking branch 'upstream/master' into test5"
This reverts commit 043a0262f7, reversing
changes made to cc4c29837d.
2021-10-16 00:20:38 +03:00
orklah
99d8f92e4f what would that do? 2021-10-15 22:33:04 +02:00
orklah
c4ebc34695 suppress or use the return type 2021-10-11 17:27:52 +02:00
orklah
5d6d3df4cf unnecessary identical child method 2021-09-26 23:34:32 +02:00
Matthew Brown
6d09418a23
Detect unused return values (#5917)
* Detect unused return values

* Allow static-returning instance methods (presumed to be fluent)

* Make $is_used the default for Codebase::methodExists
2021-06-10 14:18:15 -04:00
Bruce Weirdan
6abce3525a
Enforce use sort (#5900) 2021-06-07 22:55:21 -04:00