1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
Commit Graph

241 Commits

Author SHA1 Message Date
Bruce Weirdan
3f2ecaec7e
Allow @var annotations on global vars
The actual code was extracted from `StaticAnalyzer`

Fixes vimeo/psalm#1111
2023-02-15 01:20:03 -04:00
Jack Worman
1c19260cdd Require trailing commas 2022-12-18 13:20:31 -06:00
Jack Worman
643542346b Add codesniffer rules and expand php-cs-fixer to bin and test 2022-12-14 13:29:09 -06:00
Matthew Brown
8d36bdc3ed
Make array shapes strict by default (#8701)
* Make array shapes strict by default

* Fix PSL tests
2022-11-11 20:14:21 -05:00
1986c8b4a8
Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395)
* Immutable CodeLocation

* Remove excess clones

* Remove external clones

* Remove leftover clones

* Fix final clone issue

* Immutable storages

* Refactoring

* Fixes

* Fixes

* Fix

* Fix

* Fixes

* Simplify

* Fixes

* Fix

* Fixes

* Update

* Fix

* Cache global types

* Fix

* Update

* Update

* Fixes

* Fixes

* Refactor

* Fixes

* Fix

* Fix

* More caching

* Fix

* Fix

* Update

* Update

* Fix

* Fixes

* Update

* Refactor

* Update

* Fixes

* Break one more test

* Fix

* FIx

* Fix

* Fix

* Fix

* Fix

* Improve performance and readability

* Equivalent logic

* Fixes

* Revert

* Revert "Revert"

This reverts commit f9175100c8452c80559234200663fd4c4f4dd889.

* Fix

* Fix reference bug

* Make default TypeVisitor immutable

* Bugfix

* Remove clones

* Partial refactoring

* Refactoring

* Fixes

* Fix

* Fixes

* Fixes

* cs-fix

* Fix final bugs

* Add test

* Misc fixes

* Update

* Fixes

* Experiment with removing different property

* revert "Experiment with removing different property"

This reverts commit ac1156e077fc4ea633530d51096d27b6e88bfdf9.

* Uniform naming

* Uniform naming

* Hack hotfix

* Clean up $_FILES ref #8621

* Undo hack, try fixing properly

* Helper method

* Remove redundant call

* Partially fix bugs

* Cleanup

* Change defaults

* Fix bug

* Fix (?, hope this doesn't break anything else)

* cs-fix

* Review fixes

* Bugfix

* Bugfix

* Improve logic

* Add support for list{} and callable-list{} types, properly implement array_is_list assertions (fixes #8389)

* Default to sealed arrays

* Fix array_merge bug

* Fixes

* Fix

* Sealed type checks

* Properly infer properties-of and get_object_vars on final classes

* Fix array_map zipping

* Fix tests

* Fixes

* Fixes

* Fix more stuff

* Recursively resolve type aliases

* Fix typo

* Fixes

* Fix array_is_list assertion on keyed array

* Add BC docs

* Fixes

* fix

* Update

* Update

* Update

* Update

* Seal arrays with count assertions

* Fix #8528

* Fix

* Update

* Improve sealed array foreach logic

* get_object_vars on template properties

* Fix sealed array assertion reconciler logic

* Improved reconciler

* Add tests

* Single source of truth for test types

* Fix tests

* Fixup tests

* Fixup tests

* Fixup tests

* Update

* Fix tests

* Fix tests

* Final fixes

* Fixes

* Use list syntax only when needed

* Fix tests

* Cs-fix

* Update docs

* Update docs

* Update docs

* Update docs

* Update docs

* Document missing types

* Update docs

* Improve class-string-map docs

* Update

* Update

* I love working on psalm :)

* Keep arrays unsealed by default

* Fixup tests

* Fix syntax mistake

* cs-fix

* Fix typo

* Re-import missing types

* Keep strict types only in return types

* argc/argv fixes

* argc/argv fixes

* Fix test

* Comment-out valinor code, pinging @romm pls merge https://github.com/CuyZ/Valinor/pull/246 so we can add valinor to the psalm docs :)
2022-11-05 22:34:42 +01:00
AndrolGenhald
f9450656e1 Add support for references and improve UnusedVariable checks (fixes #7254). 2022-01-26 12:55:47 -06:00
Matthew Brown
b49682a485 Simplify issue suppression in tests 2022-01-13 14:38:17 -05:00
Matthew Brown
f439d6550b
Ensure that all entries in test arrays have explicit keys (#7386)
* Transformation that updates assertions

* Simplify transformation

* Ensure that all tests have keys

* Fix a few remaining keys
2022-01-13 13:49:37 -05:00
orklah
9d3a51db6a remove obsolete test and fix a missing exception 2022-01-05 23:08:34 +01:00
Bruce Weirdan
ab60d311c2
Merge pull request #7188 from vimeo/muglug-use-invalidscalarargument-less 2022-01-03 06:04:42 +02:00
orklah
4f7c1d05c1
remove support for allowPhpstormGenerics 2022-01-02 15:06:04 +02:00
Matthew Brown
b419c299e3
Use InvalidScalarArgument only when we can be sure PHP attempts coercion 2022-01-02 14:56:18 +02:00
orklah
16c0496d1c
Merge pull request #7157 from nowaja/master
ISSUE-5962 Fixed wrong line number for @method annotations
2021-12-15 18:37:26 +01:00
rarila
97e6511fab Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
Jakub Nowak
14c181f280 ISSUE-5962 Fixed wrong line number for @method annotations 2021-12-14 10:57:02 +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
711be643c6 Import instead of using fqn exceptions 2021-12-03 20:29:06 +01:00
ralila
245920e53c Import instead of using fqn 2021-12-03 20:11:20 +01:00
orklah
a6e4230d2d Allow overriding the signature type by a param docblock for promoted properties 2021-11-28 11:10:55 +01:00
orklah
d409c063f3 allow signature type for promoted property as well as property docblock (that will be used for param as well) 2021-11-09 19:38:18 +01:00
orklah
b53138ebde fix CS 2021-10-28 22:10:22 +02:00
orklah
067f8375cf replace exception by InvalidDocblock 2021-10-28 22:05:43 +02:00
orklah
e17ca1ba10 fix CS/test 2021-10-27 22:45:16 +02:00
orklah
9b7eabe17f allow documenting promoted properties with @var 2021-10-27 22:35:21 +02:00
orklah
a1b1080c4e prevent phpstorm generics from touching to signature types 2021-10-14 21:04:53 +02:00
orklah
570aa1bb8e fix test? 2021-08-07 10:18:06 +02:00
orklah
b194291bb3 try to fix offsets 2021-08-07 00:08:19 +02:00
orklah
10049450f8 fix tests for the last time............................................... maybe? 2021-08-05 21:48:37 +02:00
orklah
ba2f623754 fix unused variables 2021-08-05 21:32:32 +02:00
orklah
50fd9065de fix tests 2021-08-05 21:15:04 +02:00
orklah
3fe678b914 ignore UnnecessaryVarAnnotation 2021-08-05 21:05:44 +02:00
Jack Robertson
3a18ec0d51 Add expected behaviour tests 2021-07-25 10:42:40 +01:00
Bruce Weirdan
4a516005a3
Allow 0 for all bitmask types
Fixes vimeo/psalm#6119
2021-07-16 23:20:33 +03:00
Bruce Weirdan
6abce3525a
Enforce use sort (#5900) 2021-06-07 22:55:21 -04:00
Bruce Weirdan
c98b20247b
Flag unexpected tags on function docblocks (#5845)
* Flag unexpected tags on function docblocks

Fixes vimeo/psalm#5782

* Document new issue

* Fix spacing

Co-authored-by: Matthew Brown <github@muglug.com>
2021-05-28 09:47:39 -04:00
orklah
c69cf9a849
Allow empty-string in first position of an type (#5814) 2021-05-22 12:36:02 -04:00
sji
19554de6f6
Add @ignore-var and @psalm-ignore-var (#5488)
* add `@ignore-var` and `@psalm-ignore-var`

* Change two words

Co-authored-by: Matthew Brown <github@muglug.com>
2021-03-26 21:20:23 -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
Matt Brown
3d4e77beb6 Fix int-mask-of expansion 2020-11-02 00:40:36 -05:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
Brown
548ac1129c Fix crash with @var over echo 2020-09-01 00:12:12 -04:00
Brown
92239add4d Add some backwards-incompatible changes for 4.x 2020-08-30 11:44:14 -04:00
Brown
eddd7b8c11 Fix #1916 - support @var docblock annotations in more places 2020-07-26 13:23:21 -04:00
Matthew Brown
b88b169464 Fix #3882 - prevent crash when comparing object{...} to missing class 2020-07-24 09:38:51 -04:00
Brown
4d149de764 Fix #3506 - prevent black classes in throws check 2020-06-01 14:56:27 -04:00
orklah
1621a9f3ea
Add checks for duplicated params and returns (#3487) 2020-05-30 16:54:16 -04:00
Brown
bf5e178d16 Fix #3289 - treat property on non-generic type like actual value 2020-05-02 23:37:59 -04:00
Brown
2ce65e1d03 Fix #3270 - support multiple spaces before @param 2020-05-02 19:39:10 -04:00
Brown
5e2af1d7f6 Fix #1518 - add escaping of object-like keys 2020-04-26 17:36:02 -04:00