1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 17:27:28 +01:00
Commit Graph

12372 Commits

Author SHA1 Message Date
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
6fff6dfc65
Merge pull request #8788 from weirdan/fix-xml-report-crashes-on-8.1
Fixes https://github.com/vimeo/psalm/issues/8321
2022-11-28 18:11:33 -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
de96494fee
Allow omitting argument offsets for map-type overrides in phpstorm.meta
Fixes vimeo/psalm#8758
2022-11-27 16:36:34 -04:00
Bruce Weirdan
94dac9f9e7
Merge pull request #8783 from weirdan/bump-slevomat-coding-standard 2022-11-27 16:35:54 -04:00
Bruce Weirdan
ed36f2c2e8
Bump slevomat/coding-standard
This prevents issues with incompatible `phpstan/phpdoc-parser`.

`slevomat/coding-standard:8.3` claimed compatibility with
`phpstan/phpdoc-parser:^1.6`, but it fails with a fatal error when
`phpstan/phpdoc-parser:1.14` is installed (apparently there was a BC
break in a minor version of `phpstan/phpdoc-parser`).

Since 8.4 slevomat/coding-standard adopted a more conservative
dependency strategy, and they don't allow new untested versions of
`phpstan/phpdoc-parser`.

8.4 still allows PHP 7.2, so we should have no problems due to 7.x
  removal.
2022-11-27 16:16:52 -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
Bruce Weirdan
24769a2089
Merge pull request #8777 from weirdan/move-mockery-to-require-dev 2022-11-27 05:20:22 -04:00
Bruce Weirdan
a8e0ff52df
Move mockery to require-dev too 2022-11-26 21:24:13 -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
d1921b1abf
Merge pull request #8771 from weirdan/reenable-platform-check
Fixes https://github.com/vimeo/psalm/issues/7560
2022-11-26 04:09:57 -04:00
Bruce Weirdan
b8ca90c38e
Re-enable platform-check
This makes sure that we output sensible error (not very pretty, but
useful) when required extensions are missing.

Fixes vimeo/psalm#7560
2022-11-26 02:57:49 -04:00
Bruce Weirdan
074136c8ef
Merge pull request #8768 from orklah/composer-deps 2022-11-26 01:59:15 -04:00
Bruce Weirdan
d146411ae4
Merge pull request #8769 from weirdan/move-dev-plugins-to-require-dev 2022-11-26 01:57:03 -04:00
Bruce Weirdan
c3cc9062cb
Merge pull request #8770 from weirdan/upgrade-humbug-box
Fixes https://github.com/vimeo/psalm/issues/7606
Fixes https://github.com/vimeo/psalm/issues/5399
Fixes https://github.com/vimeo/psalm/issues/7314
2022-11-26 00:53:44 -04:00
Bruce Weirdan
5cbe241493
Disable parallel PHAR build
This is an attempt to fix CirleCI issue in this build:
https://app.circleci.com/pipelines/github/weirdan/psalm/666/workflows/33476cb1-d753-4e2d-b067-a5c92808d725/jobs/2457
2022-11-26 00:36:47 -04:00
Bruce Weirdan
ee34d15b4d
SA and CS fixes 2022-11-26 00:18:45 -04:00
Bruce Weirdan
683fe2f4c6
Bake version data into PHAR file
Compatibility between `ocramius/package-versions`,
`composer/package-versions-deprecated`, `composer-runtime-api` and
`humbug/box` (with `humbug/scoper` further complicating things)has been
always a problematic area. So instead of trying to keep up with all the
changes in all of those packages, we will now bake the version data (for
the packages we need) into the PHAR file itself.

Fixes vimeo/psalm#7606
Fixes vimeo/psalm#5399
2022-11-26 00:00:43 -04:00
Bruce Weirdan
369ba0635e
Update humbug/box
It updates humbug/scoper as well, so some changes to scoper
configuration are required.

`PSALM_VERSION` and `PHP_PARSER_VERSION` constants are made unscoped to
prevent various issues.
2022-11-25 23:58:41 -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
Bruce Weirdan
3ad90fa0fb
Move mockery plugin to require-dev 2022-11-25 20:15:54 -04:00
orklah
2c5052c509 bump lower dependencies 2022-11-26 00:19:55 +01: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
255a15286a
Ignore phpenv file 2022-11-25 05:31:44 -04:00
Bruce Weirdan
f7508a9874
Merge pull request #8752 from orklah/8747 2022-11-25 03:51:05 -04:00
orklah
74d37452ee Test CI on 8.2 2022-11-25 03:43:24 -04: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
Bruce Weirdan
1183476089
CS fix 2022-11-24 21:23:30 -04:00
Bruce Weirdan
42b71f5eae
Switch from phpspec/prophecy to mockery/mockery
It provides similar functionality, but is a bit more alive and does not
prevent installation with PHP 8.2
2022-11-24 21:20:21 -04:00
orklah
763556745b improve docs and phrasing about NoValue 2022-11-24 20:56:49 +01:00
orklah
b3fadbc5c1 improve docs and phrasing about NoValue 2022-11-24 20:52:49 +01: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
b53a9c322c Fix test incompatible with PHP 7.4 2022-11-24 20:06:02 +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
5ac60ddea0 Add tests 2022-11-24 19:31:53 +01:00
orklah
40df3f39d0
Merge pull request #8751 from orklah/str_starts_with
Fix #8743
2022-11-24 19:27:10 +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
orklah
8f39de9001
Merge pull request #8739 from niconoe-/fix-8735
Fix #8735: IntlDateFormatter CallMaps.
2022-11-23 18:57:53 +01:00