4c277052e3
Fix parsing of class string of unions
2022-12-04 20:28:53 +01:00
orklah
df4d3692ab
Merge pull request #8828 from orklah/generator
...
fix missing break handling in loop
2022-12-04 16:38:37 +01:00
orklah
2490230f1f
fix missing break handling in loop
2022-12-04 13:57:59 +01:00
Bruce Weirdan
45bf0d961c
Improve source autodiscovery failure message
...
The message we emitted previously did not provide any instructions on
how to resolve the issue, leaving users to guess what they need to do.
2022-12-04 04:34:08 -04:00
Bruce Weirdan
a157743140
Prevent crashes on conditional traits
...
Fixes vimeo/psalm#7863
2022-12-03 01:21:10 -04:00
Bruce Weirdan
4d8af74d92
Don't crash when accessing immutable static property
...
Fixes vimeo/psalm#8313
2022-12-03 00:51:22 -04:00
Bruce Weirdan
7364988934
Fix crash when using phantom methods as first-class callable
...
Fixes vimeo/psalm#8377
2022-12-02 23:28:22 -04:00
Barney Laurance
1dbdf7882c
Code style fix
2022-12-02 00:40:01 +00:00
Barney Laurance
ad57727593
Sort issue by position in codebase in ByIssueLevelAndTypeReport if level & type equal
...
PHP sorting only became stable in 8.0. For previous versions we would
still like duplicate issues to be sorted into a logical order.
2022-12-02 00:27:51 +00:00
Barney Laurance
54239838fe
Fix error in ByIssueLvelAndTypeReport heading
2022-12-02 00:17:27 +00:00
Barney Laurance
9e63bf6a4d
Minor code edits in ByIssueLevelAndType
2022-12-02 00:04:43 +00:00
Barney Laurance
3f5616672a
Add test for ByIsueLevelAndTypeReport
2022-12-01 23:27:53 +00:00
Barney Laurance
386aa27f4c
Improve issue level and type report
2022-12-01 23:00:48 +00:00
Barney Laurance
3bc3f1c273
Fix report name: Issue level, not issue severity
2022-12-01 22:11:29 +00:00
Barney Laurance
4fde49313e
Fix implicit constant visibility
2022-12-01 22:05:27 +00:00
Barney Laurance
aea1c5603d
Reduce function visibility
...
Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
2022-12-01 22:03:19 +00:00
Barney Laurance
32881a3c65
Add comments
2022-12-01 22:02:09 +00:00
Barney Laurance
6bde0d3a68
Delete unused code
2022-12-01 22:02:08 +00:00
Barney Laurance
b70d3e228e
WIP: Add new option --output-format=by-issue-severity to sort issues by level and type
2022-12-01 22:02:08 +00:00
orklah
433e272149
Merge pull request #8809 from danog/fix_8806
...
Fix #8806
2022-12-01 21:00:40 +01:00
796462961d
Fix
2022-12-01 20:18:07 +01:00
3150ad2b27
Fix #8806
2022-12-01 20:12:20 +01:00
orklah
b4aa951caa
Merge pull request #8798 from orklah/min_count
...
fix sealed combination
2022-12-01 18:35:02 +01:00
kkmuffme
694b7d8975
check "never" return type more strictly
...
* require explicit "never" return type when function always exits, except if it only throws
* error if function does not exit, but return type explicitly contains "never"
* Fix: https://github.com/vimeo/psalm/issues/8175
* Fix: https://github.com/vimeo/psalm/issues/8178
2022-12-01 14:51:58 +01:00
orklah
3957eb753a
fix sealed array combination
2022-11-30 23:26:34 +01:00
orklah
bce4b55525
Merge pull request #8796 from orklah/reconcileFalse
...
handle true/false reconciliation consistently, fix #8795
2022-11-30 20:35:44 +01:00
orklah
40fa8282ee
CS fix
2022-11-30 20:18:09 +01:00
orklah
229f613b8e
handle true/false reconciliation consistently, fix #8795
2022-11-30 20:15:11 +01:00
9c35ed2eb7
Ignore non-existing classes during initial scan of intersection types
2022-11-30 17:33:58 +01:00
Bruce Weirdan
870f5817d2
Merge pull request #8789 from weirdan/defer-cache-directory-creation
...
Fixes https://github.com/vimeo/psalm/issues/4267
2022-11-30 10:52:17 -04:00
Bruce Weirdan
6b3dd56850
Defer cache directory creation until it's needed
...
Honestly, this is a bit of a hack, as we let `Config` to generate the
cache directory name and then reset it to null from the cli entrypoint.
Yet it's easier than passing a no-cache flag through so many layers of
static calls.
`$this->cache_directory_initialized` flag is used to make sure we
attempt to create the directory only once.
Fixes vimeo/psalm#4267
2022-11-29 04:16:59 -04:00
Bruce Weirdan
874eb7d2ce
Fix crashes when XML report is used on PHP 8.1
...
Fixes vimeo/psalm#8321
2022-11-28 18:01:35 -04:00
Bruce Weirdan
9d597cf370
Merge pull request #8782 from weirdan/check-runtime-requirements
...
Fixes https://github.com/vimeo/psalm/issues/7560
2022-11-27 20:00:28 -04:00
Bruce Weirdan
8fa35c2228
Variables should outlive namespaces ( #8779 )
...
Variables in PHP are not namespaced. In other words, namespaces share
the context with the file they are located in.
See https://3v4l.org/2qvrC
Fixes vimeo/psalm#8778
2022-11-27 10:45:40 -05:00
Bruce Weirdan
05b8e0eea6
Replace all references to static variables when moving class ( #8780 )
...
Previously `psalter` would only replace the first occurence of the
property access. Now it replaces all properties (by keeping the old name
unknown in the context).
2022-11-27 10:44:53 -05:00
Bruce Weirdan
03def00f27
Check runtime requirements
...
`vendor/autoload/check_platform.php` may be disabled by the user
`composer.json`, so we have to repeat the check for runtime
requirements.
Fixes vimeo/psalm#7560
2022-11-27 08:05:30 -04:00
Matthew Brown
1819a2d880
Add diagnostic message when shape fields are missing ( #8762 )
...
* Add a simple diagnostic for missing array shape fields
* Fix dumb mistakes
* Allow nested shape extra keys to prompt warning too
2022-11-26 11:26:36 -05:00
Bruce Weirdan
ee34d15b4d
SA and CS fixes
2022-11-26 00:18:45 -04:00
Bruce Weirdan
1555554d9f
Centralize version data access
...
Obtaining package version data from within a scoped PHAR file is a
complicated topic, and it's been alternatively broken and fixed multiple
times.
This change moves version data access to a single class, so that we can
fix it there should we need to.
The rest of the code can just rely on PSALM_VERSION constant (which will
be made unscoped in a further commit) or call `VersionUtils` methods.
2022-11-25 23:48:54 -04:00
orklah
45ed177693
Merge pull request #8766 from Chi-teck/regexp-validation
...
Suppress errors when validation regexps
2022-11-25 20:20:15 +01:00
orklah
b9a532db26
Merge pull request #8754 from orklah/#8041
...
improve docs and phrasing about NoValue
2022-11-25 20:18:40 +01:00
orklah
2856ab1cdc
typo
...
Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
2022-11-25 20:18:27 +01:00
Ivan
ae285a3f9b
Suppress errors when validation regexps
2022-11-25 17:54:44 +00:00
Matthew Brown
a0e4468a9a
Simplify assertions generated by an array_key_exists check ( #8763 )
2022-11-25 12:16:37 -05:00
Bruce Weirdan
0b1af26011
Merge pull request #8755 from weirdan/switch-from-prophecy-to-mockery
2022-11-25 03:42:58 -04:00
Bruce Weirdan
c417af7d44
CS fix
2022-11-25 03:35:47 -04:00
Bruce Weirdan
6c77daf1f4
Upgrade mockery plugin
...
and other assorted fixes for PHP 8.2
2022-11-25 03:33:10 -04:00
orklah
4d358c4be9
improve docs and phrasing about NoValue
2022-11-24 20:49:34 +01:00
orklah
583dabee99
Merge pull request #8753 from orklah/8745
...
Fix #8745
2022-11-24 20:21:28 +01:00
orklah
ea4b099c66
Fix #8745
2022-11-24 20:02:04 +01:00