Aaron Piotrowski
1f3a37ff02
Add support for first-class callables
2021-12-09 10:54:49 -06:00
rarila
39402c233d
Return type hints ( #7065 )
...
Co-authored-by: ralila <>
2021-12-05 19:51:26 +02: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
Bruce Weirdan
0cdb0dc04a
Merge pull request #6768 from zoonru/psalm-self-out-templates
2021-11-02 21:41:16 +02:00
orklah
68a4f9e930
emit UnevaluatedCode after exit or never returning functionlike
2021-11-01 22:13:29 +01:00
5fae548e62
Add template support to @psalm-self-out
2021-10-28 10:44:37 +02:00
orklah
bee5b69f7f
use Attribute feature of PHP-Parser to avoid dealing with dynamic properties
2021-10-13 13:27:56 +02:00
orklah
870ee4ff93
->args to ->getArgs
2021-10-09 23:37:04 +02:00
orklah
8b07e69645
Merge pull request #6514 from zoonru/if-this-is
...
Add if-this-is
2021-10-04 09:49:26 +02:00
orklah
a92fee8ae3
better combining
2021-09-25 11:21:06 +02:00
741c9ee471
Fixes
2021-09-22 10:26:21 +02:00
f8a959c079
Fix silly bug
2021-09-21 14:11:33 +02:00
7e0b489efe
Merge remote-tracking branch 'origin/master' into if-this-is
2021-09-21 12:12:15 +02:00
Matt Brown
19cc4cb4ee
Simplify lots of usage checks
2021-06-25 10:14:49 -04:00
Matt Brown
67d68a5dc0
Use more accurate variable name
2021-06-25 09:54:39 -04:00
Bruce Weirdan
6abce3525a
Enforce use
sort ( #5900 )
2021-06-07 22:55:21 -04:00
Matt Brown
f3fc112bae
Fix #4523 - fix short-circuiting for properties and method calls
2021-06-01 16:06:12 -04:00
Matt Brown
44c6d3035b
Add more mixed origin information
2021-03-20 21:45:38 -04:00
Bruce Weirdan
71a0457284
Emit ImplicitToStringCast in more places ( #5344 )
...
* Emit ImplicitToStringCast in more places
Fixes vimeo/psalm#5320
`to_string_cast` is set on successful comparison, thus it needs to
always bubble up (it will be ignored in UnionTypeComparator if some part
does not match).
* Fix implicit casts
* Fix handling of string method references in self-out context
2021-03-11 00:07:39 -05:00
Matt Brown
524084a64c
Tighten up rules arouund when mutation-free methods get memoised
2020-12-08 16:39:06 -05:00
2e3s
e46c68b1e5
Overwrite memoized return type after sum-type candidate is calculated ( #4805 )
...
* Overwrite memoized return type after sum-type candidate is calculated
* Fix mismatched types
* Fix code style
2020-12-08 09:35:11 -05:00
Matt Brown
462f8ba32b
Fix #4397 - allow offsetGet on inside isset
2020-10-25 22:16:43 -04:00
Matt Brown
009b33b17d
Support @no-named-args when calling in PHP 8
2020-10-02 20:58:51 -04: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
f66d57f19d
add native return types ( #4116 )
...
* add native return types
* remove redundant phpdoc
2020-09-04 16:26:33 -04:00
Olle
13fef43ec8
Use isContainedBy instead of equals
2020-07-12 11:04:28 +00:00
Olle
5566a87e0b
Break up long line
2020-07-08 21:41:58 +00:00
Olle
ba108543e1
Fix indentation
2020-07-08 20:17:24 +00:00
Olle
285348efe9
New annotation: @psalm-if-this-is
2020-07-08 19:51:02 +00:00
Olle Härstedt
d8e8ce428e
Add new annotation: @psalm-self-out ( #3650 )
...
* Add new config: sealAllMethods
* Add some more tests
* Fix codesniffer issue with preg_quote
* Fix missing method in test
* New tag @self-out (WIP)
* Add self_out_type to method storage
* Add some notes
* More work on self-out (WIP)
* More work on self-out (WIP)
* Use psalm-self-out instead of self-out
* Remove extra file
* Cleanup
* Wrap around try-catch - how to check if a method has/should have storage?
* New method hasStorage()
* Fix indentation
* Fix some errors
* Fix indentation
* Cast storage type to type
* Add proper use-statement in method storage
* Correct test class name
* Allow self_out to be null
* method_id can be string (why, when?)
Co-authored-by: Olle <noemail>
2020-07-01 18:10:24 -04:00
Olle
ee9a7c00fe
method_id can be string (why, when?)
2020-06-30 16:02:48 +00:00
Olle
111f4b4f6e
Add proper use-statement in method storage
2020-06-30 15:33:14 +00:00
Olle
4cd3c93d0d
Cast storage type to type
2020-06-30 15:22:55 +00:00
Olle
dbf5628683
Fix some errors
2020-06-24 22:46:09 +00:00
Olle
966479387f
Fix indentation
2020-06-24 20:36:04 +00:00
Olle
8831d54170
Wrap around try-catch - how to check if a method has/should have storage?
2020-06-23 19:01:32 +00:00
Olle
a615f4423b
More work on self-out (WIP)
2020-06-21 23:06:04 +00:00
Olle
fffbccdacb
More work on self-out (WIP)
2020-06-21 22:18:14 +00:00
Olle
20cde0ca2c
New tag @self-out (WIP)
2020-06-18 20:46:49 +00:00
Brown
8e5b330c5a
Break apart CallAnalyzer
2020-05-18 22:57:00 -04:00
Brown
5b06c206e0
Move classes into deeper namespace
2020-05-18 22:52:33 -04:00
Brown
5ee1487a01
Make ExpressionAnalyzer more beautiful
2020-05-18 15:13:27 -04:00
m0003r
4d1be3f0c4
Allow plain assertions (@psalm-assert) about $this ( fixes #3105 ) ( #3108 )
...
* Allow plain assertions (@psalm-assert) about $this (fixes #3105 )
* Fix multiple assertion combining
* Fix multiple assertion combining for $this again
* Add test for multiple assertion combining for $this again
2020-04-09 08:15:07 -04:00
Matthew Brown
0022de1f13
Fix #946 - allow too many arguments when one of union agrees
2020-03-15 13:44:00 -04:00
Matthew Brown
329c9afdf5
Actually remove method
2020-03-11 23:20:19 -04:00
Matthew Brown
bfb919d26a
Break out methods into their own classes
2020-03-11 23:04:52 -04:00
Matthew Brown
d2950af636
Break apart MethodCallAnalyzer a bit
2020-03-11 09:38:09 -04:00
Brown
2a72990d62
Add back support for unused method checks
2020-03-09 18:55:35 -04:00