1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 10:38:49 +01:00
Commit Graph

8568 Commits

Author SHA1 Message Date
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
orklah
bca202bf5e
Merge pull request #8749 from Nicelocal/fix_8748
Fix #8748
2022-11-24 19:44:44 +01:00
orklah
203d2c2b3d Fix #8747 2022-11-24 19:17:23 +01:00
85071b61a3 Fix #8748 2022-11-24 11:28:00 +01:00
Bruce Weirdan
262c7ffa2b
Correct Clause::$hash type 2022-11-23 12:59:13 -04:00
orklah
16ba29836b
Merge pull request #8736 from weirdan/simplify-issue-sorting
Simplify issue sorting
2022-11-23 06:58:52 +01:00
orklah
3b6faf9638
Merge pull request #8737 from weirdan/enforce-arrow-function-formatting
Enforce arrow function formatting
2022-11-23 06:58:34 +01:00
54db59682d
Allow parameter types to be contained by a class template type (#8731)
* Allow parameter types to be contained by a class template type in function calls

* Specify PHP version of tests

* Fix tests
2022-11-23 00:14:30 -05:00
Bruce Weirdan
026354a18e
Enforce arrow function formatting 2022-11-23 00:08:29 -04:00
Bruce Weirdan
8e941c1439
CS fix 2022-11-22 23:59:33 -04:00
Bruce Weirdan
45b49df92e Simplify issue sorting
As we're on 7.4 now, we can use more concise constructs
2022-11-22 23:18:50 -04:00
kkmuffme
ce84a80c6d include CLI args in PHP errors to more quickly identify run issues in CI 2022-11-20 11:15:45 +01:00
Bruce Weirdan
6554aa05a7
Emit MixedMethodCall when calling new on object 2022-11-19 17:29:35 -04:00
Bruce Weirdan
d7561919b2
Allow new on objects
Fixes vimeo/psalm#8355
2022-11-19 16:53:07 -04:00
orklah
4e17585093
Merge pull request #8714 from kkmuffme/dont-rewrite-config-hash-to-cache-when-unchanged
Fix cache race condition due to missing repopulation of lock files cache
2022-11-18 22:08:37 +01:00