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

71 Commits

Author SHA1 Message Date
Bruce Weirdan
b4f024b1fe
Basic enum checks
* Duplicate cases
* Duplicate case values
* Invalid case values: value on a pure enum case, missing value on a
backed enum case, backing type / case type mismatch
* Literal expression evaluation for case values

Fixes vimeo/psalm#6426
Fixes vimeo/psalm#6427
2021-09-07 12:35:38 +03:00
Bruce Weirdan
7b11024886
Flag invalid backing types for enums
Fixes vimeo/psalm#6428
2021-09-05 20:12:24 +03:00
Matthew Brown
832a190dd4
Support enums (#5699)
* Add initial enum preparation

* Support cases method

* Ignore bad use error

cc @weirdan

* Fix type
2021-05-03 17:54:09 -04:00
Matt Brown
698adeff07 Rename incorrectly-named test 2021-04-25 18:26:00 -04: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
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
Brown
4a434d9a2f Add separate issue for undefined classes in docblocks 2019-05-15 18:41:26 -04:00
Bruce Weirdan
9bdc9f774f More provider typing 2019-03-02 08:43:19 -05:00
Bruce Weirdan
8408effe57 Dropped unused uses 2019-02-17 13:17:45 -05:00
Matthew Brown
09ee6e3d13 Fix #1253 - prevent ints from coercing to literal floats 2019-01-27 23:21:54 -05:00
Matthew Brown
89999fd554 Add suppport for float enums
Fixes #1099
2019-01-27 18:34:13 -05:00
Brown
f5a81249e0 Fix #1202 - don’t allow undefined constants in enums 2019-01-15 11:31:13 -05:00
Matthew Brown
4688b25fd9 Move internal classes to own namespace 2018-11-12 11:20:59 -05:00
Matthew Brown
b9018a4a03 Fix #936 - add support for class constants in enums 2018-08-08 23:12:12 -04:00
Matthew Brown
97bca6d762 Fix const test name 2018-08-08 21:46:37 -04:00
Matthew Brown
9880e2bede Prevent leading-number constants in docblocks 2018-08-08 21:36:33 -04:00
Matthew Brown
d9af167e38 Fix #931 - replace self in enum declaration where possible 2018-08-08 20:59:21 -04:00
Matthew Brown
55be2c3ce4 Fix #934 - allow numbers in class constant enums 2018-08-08 20:36:16 -04:00
Matthew Brown
228337415b Fix #761 - add support for class constants in enums 2018-05-21 00:46:56 -04:00
Matthew Brown
19ca1c9311 Suppress enum redundant conditions too 2018-05-20 18:58:34 -04:00
Matthew Brown
6250c2a14c Fix #16 - add support for enums 2018-05-20 17:19:53 -04:00