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

136 Commits

Author SHA1 Message Date
orklah
fc281672ea fix wrong detection of purity 2022-01-31 20:52:25 +01:00
rarila
97e6511fab Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
rarila
39402c233d
Return type hints (#7065)
Co-authored-by: ralila <>
2021-12-05 19:51:26 +02:00
ralila
8fb2e0f885 Handle some partials 2021-12-04 21:55:53 +01:00
ralila
f833085a15 Fix fqn usage in php-doc 2021-12-04 03:37:19 +01:00
ralila
245920e53c Import instead of using fqn 2021-12-03 20:11:20 +01:00
Bruce Weirdan
d19aad7db1
Display target PHP version
Historically it was often not quite clear to users what PHP version
Psalm assumes, and why. This PR addresses this issue by printing the
version and where we got it from right before scanning the files.
2021-11-27 02:18:09 +02:00
244a90ca4f
Fix #6665 2021-10-14 10:56:54 +02:00
24f1b60e53
Fix nullable unions 2021-10-13 14:05:48 +02:00
ce60fa2151
Cleanup 2021-10-13 11:26:01 +02:00
b6e7201b5a
Forbid static in parameter typehint 2021-10-13 11:22:33 +02:00
1c99af205b
Fix manipulation of intersection types, arrow functions, foreign static types, T|false|null unions. 2021-10-13 11:13:43 +02:00
orklah
ecb541ea51 add test 2021-10-05 19:49:05 +02:00
orklah
dbc70900ff fix tests 2021-10-05 13:41:40 +02:00
orklah
13c2ba61ea fix tests 2021-10-05 13:41:20 +02:00
orklah
902206b3ee
Merge pull request #6578 from orklah/psalter-psalm-param
Psalter psalm-param
2021-10-05 12:51:52 +02:00
orklah
66206bf061 fix wrong type description added in signature 2021-10-04 12:26:05 +02:00
orklah
fffe6428de fix tests 2021-10-04 01:13:16 +02:00
orklah
4f696ec3b4 add/fix tests 2021-10-04 01:01:57 +02:00
orklah
5a99c9be94 offset the starting position of the function in case of attributes 2021-09-29 21:19:04 +02:00
Bruce Weirdan
b39e765475
Prevent failures with dev PHP versions
It was failing with dev versions, e.g. `8.2.0-dev`
2021-09-07 01:43:03 +03:00
Bruce Weirdan
76be96ce53
Drop FakeFileProvider from tests folder
And use Psalm\Internal\Provider\FakeFileProvider
2021-07-02 03:57:57 +03:00
orklah
872f1c232c
allow Psalter to fix RedundantCast (#5948)
* allow Psalter to fix RedundantCast

* fix test
2021-06-17 18:15:45 -04:00
orklah
cfa5492286
Remove redundant namespaced phpdoc (#5936)
* remove array-key from generated phpdoc

* remove mixed value too

* fix tests

* fix mixed suppression

* revert back to array to prevent breaking refactoring
2021-06-16 11:16:20 -04:00
Bruce Weirdan
6abce3525a
Enforce use sort (#5900) 2021-06-07 22:55:21 -04:00
orklah
3bcfd2e726
allow psalter to add literal string/int in psalm phpdoc (#5844)
* allow psalter to add literal string/int in psalm phpdoc

* fix CS
2021-05-28 09:46:11 -04:00
orklah
de1bb954cf
Handle the case where a switch return on each case (#5819)
* Handle the case where a switch return on each case

* introduce a "hybrid" case exit type for cases where there's both "none" and something else
2021-05-23 16:24:29 -04:00
pawel-slowik
d82f02879c
Don't migrate virtual nodes (#5780)
* Add a failing test for issue #5002

* Don't try to migrate virtual nodes

Fixes #5002
2021-05-17 22:21:32 -04:00
Bruce Weirdan
9e19653a72
Infer never return type (#5710)
* Allow __toString to return never

Fixes vimeo/psalm#5653

* Push $return_is_exit down

* Produce unique control actions

* Test suggesting `@return never`
2021-05-05 01:22:29 -04:00
orklah
343d020408
improve psalter capacities for anonymous class extending real classes (#5146) 2021-02-04 09:59:38 -05:00
Ben Davies
53afd2857d
Split unit test over multiple jobs in GitHub Actions, lowering the total run time (#4985)
* Split unit test over multiple jobs in GitHub Actions, lowering the total run time

* rename FileManipulationTest to FileManipulationTestCase so it does not run as a standalone Test
2021-01-11 17:30:33 -05:00
orklah
1d9987e0ed
fix phpdoc (#4905) 2020-12-29 11:42:41 +00:00
orklah
f0c0ac0616
handle return flag for a try/catch/finally (#4746)
* handle return flag for a try/catch/finally

* add tests for psalter
2020-12-01 12:55:27 -05:00
Matt Brown
b14a62338e Fix test 2020-11-23 13:14:40 -05:00
Matt Brown
baca927aab Fix #4643 - use PHP8 union types when possible 2020-11-21 22:50:56 -05:00
Matt Brown
3728837ef9 Only run unused code analysis where necessary 2020-11-21 18:25:18 -05:00
orklah
509a937d1b
use int|string in phpdoc format for array-key (#4645) 2020-11-21 17:38:40 -05:00
orklah
6b72599ec5
allow static return type in PHP8 (#4641) 2020-11-20 18:46:35 -05:00
orklah
e04f219948
return static instead of self when static context detected (#4632)
* return this instead of self when static context detected

* replace $this by static
2020-11-19 19:02:25 -05:00
Matt Brown
ab3961d9b3 Sanity check to ensure closure uses aren’t removed 2020-11-18 00:38:28 -05:00
Matt Brown
c9e47450a7 Fix #4266 - prevent OOM when analysing closure unioned with invokable class 2020-10-02 00:47:42 -04:00
Matt Brown
14efde286f 4.x - refactor unused variable detection
This turns unused variable detection into an explicit control-flow problem, where before we had a more simplistic mark-and-sweep algorithm
2020-09-30 12:28:13 -04:00
orklah
37a2f8a33d
unused use statements (#4228) 2020-09-22 01:10:46 -04:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
Brown
68ebef2a2e Clean up immutable fix 2020-09-03 15:32:14 -04:00
Brown
28a107e620 Fix #4112 - allow slashes in docblock tag names 2020-09-02 19:39:59 -04:00
Brown
92239add4d Add some backwards-incompatible changes for 4.x 2020-08-30 11:44:14 -04:00
Brown
4e10a0ed6f Fix #4036 - add immutable annotations automatically too 2020-08-24 19:29:00 -04:00
Brown
94cec15598 Only add pure when not overriding upstream 2020-08-23 22:16:03 -04:00
Brown
6103cf0f51 Fix ImpureVariable test 2020-08-23 22:07:02 -04:00