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

81 Commits

Author SHA1 Message Date
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
748a74bb2c Merge remote-tracking branch 'origin/4.x' into HEAD 2022-10-16 13:41:27 +02:00
Jack Worman
3b76ac85dc Count Report Format 2022-07-10 17:50:50 -05:00
Aleksandr Zhuravlev
b4fdc3e326 Made most of callbacks static. Reworked some array_map() into foreach() 2022-04-09 21:58:26 +12:00
Bruce Weirdan
3e837cabd0
Finalize (and internalize) more classes 2022-02-05 23:51:03 +02:00
Bruce Weirdan
638a10dd39
Restore return docblock 2022-01-06 01:58:52 +02:00
Bruce Weirdan
8726065d21
Applied ClosureToArrowFunctionRector 2022-01-06 00:48:04 +02: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
Bruce Weirdan
e9d9481ea6
Merge pull request #7060 from rarila/codingstyle-convert-fqn 2021-12-05 02:46:03 +02:00
Bruce Weirdan
14dcbc908a
Don't output console links in CI env (#7049) 2021-12-04 19:49:24 +02:00
ralila
2a956498bf Import instead of using fqn functions 2021-12-03 21:07:25 +01:00
ralila
245920e53c Import instead of using fqn 2021-12-03 20:11:20 +01:00
Bruce Weirdan
99d3d5e811
Escape GHA output
Refs Roave/BackwardCompatibilityCheck#342

Thanks @staabm for highlighting this issue.
2021-11-29 04:47:47 +02:00
Bruce Weirdan
ec1571d261
Adjust link test to account for colors 2021-11-28 01:14:03 +02:00
Andrey Savchenko
03ae329837
Colorized file name and line in console output
Fixes #4129
2021-11-28 01:06:21 +02:00
Bruce Weirdan
4cab21d903
Use snake_case property name 2021-11-14 22:55:12 +02:00
Bruce Weirdan
bc604a36c1
Do not output links with --monochrome flag on 2021-11-14 22:50:08 +02:00
Gregor Harlan
ab0049d0ff
ConsoleReport: Add links to open file in editor 2021-11-07 15:04:14 +01:00
Bruce Weirdan
6610a2f918
Improve Github Actions output
* Use issue type in title
* Also provide issue type and location in the (use-visible) error message

Fixes vimeo/psalm#6817
2021-11-04 03:03:25 +02:00
orklah
46801c4b98 clearer string operations 2021-09-26 23:34:31 +02:00
orklah
a5aa824258 unnecessary local variable 2021-09-26 22:37:17 +02:00
orklah
97e91e6bf0 code trimming 2021-09-25 02:34:21 +02:00
Bruce Weirdan
abf557da44
Encode XML output consistently
This fixes test failures when running on PHP 8.1, due to changed
`htmlspecialchars()` defaults
2021-09-05 20:06:59 +03:00
Bruce Weirdan
b149097086
Replace array cast with get_object_vars() which Psalm understands 2021-07-20 23:26:15 +03:00
Nathan Dench
39555a2df8 add type signature in XmlReport 2021-07-20 21:54:44 +10:00
Nathan Dench
ca2c125218 fix: Handle DataFlowNodeData in XmlReport 2021-07-20 21:39:09 +10:00
Claas Augner
d0df69afb5 Fix CodeClimateReport to use relative paths
Both GitLab and the Code Climate Engine Specification require the code
climate report to contain the *relative* path to the source code file.
2021-07-16 22:39:47 +02:00
Bruce Weirdan
6abce3525a
Enforce use sort (#5900) 2021-06-07 22:55:21 -04:00
Samuel Parkinson
264c454ad0
Add issue link to GitHub Actions report (#5759)
If an issue link is available, include it in the annotations on GitHub.
2021-05-14 20:24:19 -04:00
Bruce Weirdan
aa854ae338
Link to SARIF JSON schema (#5718)
Fixes vimeo/psalm#5716
2021-05-05 21:47:36 -04:00
Matt Brown
3046468d1e Add hints for MixedAssignment issues 2021-03-17 01:10:42 -04:00
Egor Talantsev
a4c4215fab
Change code-climate line reference (#5262) 2021-02-22 09:20:33 -05:00
Lukas Bestle
2d17b744ce
SARIF report: Include help links (#4924) 2021-01-03 01:45:21 +00:00
orklah
1901ea56de
Don't add link if the issue doesn't have a shortcode (#4786) 2020-12-06 11:29:05 -05:00
Matt Brown
0efd4ebd7d Detect some erroneous issets 2020-11-29 09:26:39 -05:00
Matt Brown
6db8132b4c Simplify call analysers a bit
Ref #4714
2020-11-27 16:31:10 -05:00
Olivier Doucet
70a130f11e
add CodeClimate output format (#4387)
* add CodeClimate output format

* cosmetic fixes

* add CodeClimate output format

* cosmetic fixes

* phpcs fixes
2020-11-23 15:34:51 -05:00
Lukas Reschke
494ec40777
Add SARIF as report output (#4582)
https://docs.oasis-open.org/sarif/sarif/v2.0/sarif-v2.0.html
2020-11-17 13:23:20 -05:00
orklah
ceaaa39ec3
improve phpdoc (#4352) 2020-10-17 12:36:44 -04:00
Matt Brown
516141a380 Rename ControlFlowGraph to more appropriate DataFlowGraph 2020-10-13 16:49:03 -04:00
Matt Brown
b08d70f977 Fix #4252 - fix xml generation 2020-10-12 18:39:26 -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
aheart
8da6feb7b7
Filter selected text to prevent invalid XML (#4234) 2020-09-22 13:44:14 -04:00
Brown
56cddd16bf Rename TaintGraph to ControlFlowGraph because it’s about to do more 2020-09-20 23:59:52 -04:00
orklah
b4bfbb6a28
remove incorrect inheritDoc (#4220) 2020-09-20 12:55:10 -04:00
orklah
a9a364e363
Misc improvements (#4216)
* misc changes

* fix CI
2020-09-20 08:55:28 -04:00
orklah
b19f0a7034
Remove empty() and use strict comparison when safe (#4211)
* replace empty usage with stricter checks

* use strict comparison when safe

* replace is_null with === null for consistency
2020-09-19 18:26:51 -04:00
Andrey Savchenko
3e1758deea
Changed path output in PhpStorm report to absolute (#4159)
Needs to be absolute to be recognized and linked up by PhpStorm terminal (at least for me on Windows).

See #3271, https://youtrack.jetbrains.com/issue/IDEA-154439
2020-09-08 14:29:46 -04:00