1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-03 18:17:55 +01:00
Commit Graph

96 Commits

Author SHA1 Message Date
Maximilian Bösing
dac82e95dc
qa: re-enable skipped test for class constant assertions
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-11-15 18:49:51 +01:00
Aleksandr Zhuravlev
b664850cdc Added support of asserting properties of objects out of scope 2021-10-17 21:29:25 +13:00
Aleksandr Zhuravlev
657f8e22ed Made the test marked 7.4 2021-10-14 22:05:40 +13:00
Aleksandr Zhuravlev
cbb67c0672 Stubbed RelfectionNamedType 2021-10-14 11:09:52 +13:00
orklah
2e64854a6c don't allow getAssertionString to return a part of the Union 2021-10-11 16:07:57 +02:00
orklah
ee4dbafca9 fix test 2021-10-02 10:02:24 +02:00
Fran Moreno
decb397b8e
Add ReflectionProperty::getType() and hasType() 2021-07-10 13:05:57 +02:00
AndrolGenhald
d4590711d6
Fix object-like array keys when combining string and automatic keys (fixes #5427). (#5428)
* Fix object-like array keys (fixes #5427).

* Fix incorrect return types for tests.

* Fix false positive list with literal int key.
2021-03-19 21:44:44 -04:00
Matt Brown
9d979e3467 Fix #5406 - track more changes to assertion type 2021-03-16 16:33:09 -04:00
Matt Brown
c97ee5ccdb Fix #5258 - allow ReflectionParameeter::hasType() to inform getType() return 2021-03-06 16:54:23 -05:00
Matt Brown
4c65d3b424 Fix #5310 - allow iterable coercion from generic object 2021-03-03 00:13:00 -05:00
Matt Brown
0624098865 Ensure getId() output can always be parsed as a type
Ref #5105
2021-01-25 23:41:51 -05:00
Matt Brown
f1107ab4d9 Fix #5049 - assertion of !empty on bool makes true 2021-01-19 17:19:47 -05:00
Matt Brown
4378bec917 Fix #5025 - prevent crash in assert function during reflection 2021-01-17 12:08:19 -05:00
Bruce Weirdan
89ff4282df
Allow assertions on static class properties (#4833)
* Minimal implementation for assertions on static properties

* Added inheritance tests

* Add support for `ClassName::$var`

* Import strpos() to keep phpcs happy

* Add support for conditional assertions on static properties
2020-12-21 17:05:44 +00:00
orklah
5222cadfb3
Check from_docblock property to emit the right issue (#4736) 2020-11-29 21:40:13 -05:00
Matt Brown
18f3a3721f Fix #4414 - allow multiple @psalm-assert-if-true on same var 2020-10-25 10:49:39 -04:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
Bruce Weirdan
4dcb7183f5
Fix windows tests (#4040)
* Fix windows tests by not mangling the expectations

* Use platform-dependent directory separator in expected messages

* fix CS
2020-08-22 10:00:36 -04:00
Brown
42c3a703b5 Fix #3741 - detect scalar class constants in if-true assertions 2020-08-12 17:03:41 -04:00
Brown
7367e8e6c2 Allow assertions of non-empty lists on typed lists
Fixes #3906
2020-07-29 18:10:43 -04:00
Brown
223b0619c5 Fix #3858 - support @psalm-assert falsy for abort_if expressions 2020-07-21 12:55:11 -04:00
Brown
2399643472 Fix #3811 - allow more complex negations inside boolean expressions 2020-07-13 21:31:58 -04:00
Brown
98622783ec Allow lists to have their types refined
Fixes #3605
2020-06-18 10:01:16 -04:00
Matthew Brown
15e753e279 Fix #3443 - add InvalidDocblock issue for @psalm-assert Foo|!Bar 2020-05-23 22:52:21 -04:00
m0003r
1749c19a29
Fix $assertion_var_id calculation in method calls (#3115) 2020-04-09 23:03:53 -04:00
Brown
09663b5938 Fix #3095 - allow intersection of arrays after assertions 2020-04-09 23:02:28 -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
Brown
3c9ec90919 Fix deprecated call 2020-04-03 14:56:11 -04:00
Brown
adbe44d7bb Revert countable checks 2020-01-31 15:24:44 -05:00
Brown
37765098e9 Fix #2725 - allow empty checks on objects that implement countable 2020-01-31 12:55:33 -05:00
Matthew Brown
ff01f41b44 Allow strings in assert annotation 2020-01-27 23:15:50 -05:00
Matthew Brown
8ccd4860e3 fclose should treat resource as passed-by-reference 2020-01-17 13:12:00 -05:00
Matthew Brown
adf230e873 Fix #2636 - allow non-empty-list in assert annotation 2020-01-17 09:06:34 -05:00
Brown
2c7197ab4b Fix #2578 - improve inference of functions beginning with assert 2020-01-09 15:45:17 -05:00
Matthew Brown
16b8edd583 Fix #2409 - use more robust assertion parsing 2019-12-31 09:10:14 -05:00
Matthew Brown
366e2d30a3 Improve assertions support a bit more 2019-12-30 10:48:50 -05:00
Matthew Brown
19faa31865 Allow assertions on nested properties 2019-12-30 10:01:31 -05:00
Matthew Brown
15cd62d332 Fix #2484 - add support for spaces in assert-if-true types 2019-12-19 19:24:26 +00:00
Matthew Brown
3faf1f8bc2 Improve int assertions 2019-12-10 09:44:38 -05:00
Brown
74de32fefe Allow multiple @psalm-assert annotations for a given variable 2019-12-09 17:21:58 -05:00
Brown
842b2a53df Refine lists with object-like array types
Fixes #2357
2019-11-26 12:22:28 -05:00
Brown
0bcb7863f3 Use better system for storing inferred types and assertions 2019-11-25 11:44:54 -05:00
Matthew Brown
0ac5c32f2f Fix #2277 - scan psalm-assert types always 2019-10-25 23:39:33 +02:00
Brown
67b32f463e Support assertions on lists 2019-10-10 10:57:43 -04:00
Brown
56856f3da0 Break up assert tests 2019-10-01 17:09:34 -04:00