Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Default baseline file #10592

Closed
wants to merge 383 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
383 commits
Select commit Hold shift + click to select a range
276a25d
Fix falsable issues with json_encode
robchett Oct 9, 2023
f62fd82
Fix falsable issues with ini_get/getopt
robchett Oct 9, 2023
ad4dc77
Fix falsable issues with base64_decode
robchett Oct 9, 2023
ae8e740
Fix falsable issues with igbinary_serialize
robchett Oct 9, 2023
e677c68
Fix falsable issue with strtotime
robchett Oct 9, 2023
5a43e99
Fix falsable return issues from array functions, reset/key/shift
robchett Oct 9, 2023
6de539e
Fix falsable issues with file i/o functions
robchett Oct 9, 2023
0bd4f9b
Update baseline for remaining nullable/falsable issues
robchett Oct 9, 2023
8f9f8d0
Merge pull request #10211 from robchett/disable_ignoreInternalFunctio…
orklah Oct 16, 2023
67d6468
Merge pull request #10276 from braindawg/addIntlExtensionStubs
orklah Oct 16, 2023
0f8a320
Rollback some changes
robchett Oct 17, 2023
24168f6
Merge pull request #9794 from robchett/remove_TCallableArray_and_TCal…
orklah Oct 17, 2023
ec959e9
Merge remote-tracking branch 'origin/master' into strict_types
danog Oct 19, 2023
a233e62
cs-fix
danog Oct 19, 2023
5953b1c
Fixes
danog Oct 19, 2023
1745c83
Finalize all classes
danog Oct 19, 2023
5088dc0
Minor fix
danog Oct 19, 2023
3e6294e
Simplify
danog Oct 19, 2023
fe4928c
Add suppression and note
danog Oct 19, 2023
394e385
Strict types everywhere
danog Oct 19, 2023
1c9092e
Update baseline
danog Oct 19, 2023
0f41831
Fix windows CI
danog Oct 19, 2023
076bd85
Fixes
danog Oct 19, 2023
989d171
Fixes
danog Oct 19, 2023
7761939
Strict properties
danog Oct 19, 2023
efb86f8
cs-fix
danog Oct 19, 2023
1988be4
One more type
danog Oct 19, 2023
09a606c
Readonly
danog Oct 19, 2023
2d43c16
Revert due to reset() in getSingleAtomic
danog Oct 19, 2023
c9493c5
First pass
danog Oct 19, 2023
575db97
Revert tests
danog Oct 19, 2023
900807d
Fixes
danog Oct 19, 2023
19a5c01
Fix
danog Oct 19, 2023
4d4b6ca
More finalization
danog Oct 19, 2023
0b25592
Fix
danog Oct 19, 2023
7890085
Fix
danog Oct 19, 2023
048f55d
Fixes
danog Oct 19, 2023
d5ab48e
Fix
danog Oct 19, 2023
1cf3233
Fix
danog Oct 19, 2023
3852123
Fix
danog Oct 19, 2023
9ddc39d
Fix
danog Oct 19, 2023
a8ccc92
Update
danog Oct 19, 2023
34b4272
Fixup
danog Oct 19, 2023
f3c6193
Fix
danog Oct 19, 2023
887d2ff
Fix
danog Oct 19, 2023
69cddcf
Update
danog Oct 19, 2023
9d3fee4
Fix
danog Oct 19, 2023
dd2d3a2
Fixes
danog Oct 20, 2023
c88fa5c
Fix
danog Oct 20, 2023
dd8ee0f
Remove legacy code
danog Oct 20, 2023
75fcfe3
Merge pull request #10044 from nicelocal/strict_types
orklah Oct 21, 2023
96f2dde
Merge remote-tracking branch 'origin/5.x'
danog Oct 21, 2023
7f92c33
Merge branch 'rector'
danog Oct 21, 2023
97e5a07
Switch back to function JIT
danog Oct 21, 2023
e3396aa
Fixes
danog Oct 21, 2023
e19caf0
Fix
danog Oct 21, 2023
8ff340e
Fixup
danog Oct 21, 2023
b709673
Fixes
danog Oct 21, 2023
d0f832f
cs-fixes
danog Oct 21, 2023
a36d2fc
cs-fixes
danog Oct 21, 2023
1175c71
Update
danog Oct 21, 2023
cb48b00
cs-fix
danog Oct 21, 2023
4a433d3
More readonly props
danog Oct 21, 2023
f1d7843
Make more properties readonly
danog Oct 21, 2023
b2bde47
cs-fix
danog Oct 21, 2023
6613c92
Revert
danog Oct 21, 2023
64ef0d9
cs-fix
danog Oct 21, 2023
b62fe44
Fix
danog Oct 21, 2023
46ae91e
Fix
danog Oct 21, 2023
17b70c5
Fixes
danog Oct 21, 2023
90dea2f
Fix
danog Oct 21, 2023
dc2b724
cs-fix
danog Oct 21, 2023
601c842
Merge branch 'rector_5.x'
danog Oct 21, 2023
3017016
Merge branch 'rector_5.x'
danog Oct 21, 2023
71483b7
Merge remote-tracking branch 'origin/5.x' into v6_fixes
danog Oct 22, 2023
e8b7b30
Fixes
danog Oct 22, 2023
292ed06
Fix
danog Oct 22, 2023
8fadd1b
cs-fix
danog Oct 22, 2023
e72fb5a
Fix
danog Oct 22, 2023
147505c
Merge pull request #10310 from nicelocal/v6_fixes
orklah Oct 22, 2023
4b1c2dd
Merge remote-tracking branch 'origin/master'
danog Oct 22, 2023
fa97e6d
Fix
danog Oct 22, 2023
6044cc7
Combining a array value empty list with a non-empty list was returnin…
robchett May 14, 2023
d07b575
Stub constants for ZipArchive from ext-zip
braindawg Oct 31, 2023
349770f
Add constants from SOAP extension to stub
braindawg Oct 31, 2023
cfe57e9
Fix redundant PHP tag in SOAP stub
braindawg Nov 1, 2023
97a7cf8
Allow enum cases to be global constants
robchett Nov 2, 2023
c93fe14
Hotfix shepard build - see #10342
robchett Nov 3, 2023
f2343ed
Add progress for scanning stage
robchett Nov 3, 2023
b880339
Merge pull request #10343 from robchett/hotfix_shepard_build
orklah Nov 3, 2023
4ce7f9f
Merge pull request #10333 from braindawg/addStubConstantsForSOAP
orklah Nov 3, 2023
65f7d7f
Merge pull request #10345 from robchett/scanner_progress
orklah Nov 3, 2023
b9c82d3
Merge pull request #9787 from robchett/remove_non-empty-list_status_w…
orklah Nov 3, 2023
e6564c6
Merge pull request #10339 from robchett/global_const_as_enum_case
orklah Nov 3, 2023
54999ab
Allow (no-)seal-(properties|methods) without the psalm- prefix
robchett Nov 3, 2023
3448c47
Warn when an issue handler suppression is unused
robchett Nov 2, 2023
ccabf21
Remove unused suppressions
robchett Nov 2, 2023
16c06b9
Fix stub for RecursiveArrayIterator::getChildren
robchett Nov 2, 2023
d05bd54
Use CommentAnalyzer::sanitizeDocblockType consistently
robchett Oct 26, 2023
934383e
Fix for spaces after , in multiline docblock types
robchett Oct 26, 2023
39ac69b
Fix parsing of class-string-map<T of Foo, T>
robchett Oct 26, 2023
e76db14
Suppress '@template T as' test failures
robchett Oct 26, 2023
70a83c8
Skip inline docblocks like {@see ...}
robchett Oct 26, 2023
f507838
Fix some stub docblocks that were thowing parse errors
robchett Oct 26, 2023
3cf9334
Sanitize docblocks for psalm-check-type
robchett Nov 2, 2023
ec5eae3
Maintain loop start value after an increment
robchett Oct 8, 2023
d925bf5
Correct decrement min/max ranges
robchett Oct 8, 2023
8414d70
Better reconciling of ++/-- operators in ints
robchett Oct 8, 2023
fecc4eb
Rework test as it was a false negative
robchett Oct 26, 2023
302fb72
Merge pull request #10326 from robchett/consistent_type_docblock_parsing
orklah Nov 4, 2023
be48d10
Merge pull request #10340 from robchett/RecursiveArrayIterator_stub_c…
orklah Nov 4, 2023
f147344
Merge pull request #10341 from robchett/report_unused_issue_handler_s…
orklah Nov 4, 2023
d041b65
Merge pull request #10344 from robchett/seal_method_seal_properties_w…
orklah Nov 4, 2023
7233f38
Merge pull request #10263 from robchett/maintain_loop_start_val_after…
orklah Nov 4, 2023
b775d29
Merge pull request #10332 from braindawg/addZipExtensionStub
orklah Nov 4, 2023
86f503a
Docblock psudo methods can be inherited via @mixin
robchett Nov 8, 2023
f4aef37
A segment of progress was being output early as the startScanningFile…
robchett Nov 9, 2023
61f02d8
Detect magic method signature mismatch on interfaces
robchett Nov 9, 2023
44f9440
Only inherit docblock param type if they type was not expanded
robchett Nov 9, 2023
68d6d9b
Trigger ImplementedParamTypeMismatch if concrete implementation of ma…
robchett Nov 9, 2023
975d590
Don't inherit psuedo methods from parent if a concrete implementation…
robchett Nov 9, 2023
ac46506
Warn if @method annotation contradicts concrete function
robchett Nov 9, 2023
80edd41
Fix failing tests with invalid code
robchett Nov 9, 2023
84ed631
Correct test min php version
robchett Nov 9, 2023
fb7fc1c
Remove MixedInferredReturnType as the related issue is more accuratly…
robchett May 13, 2023
70075e7
Allow type aliases for static variables
robchett Nov 9, 2023
5de8390
Merge pull request #10362 from robchett/type_aliases_for_static_state…
orklah Nov 13, 2023
3efb292
Merge pull request #9783 from robchett/remove_MixedInferredReturnType
orklah Nov 13, 2023
e85413d
Merge pull request #10356 from robchett/inherit_magic_methods_from_mixin
orklah Nov 13, 2023
bb4d808
Merge pull request #10361 from robchett/method_annotation_fixes
orklah Nov 13, 2023
5095f4e
Merge pull request #10360 from robchett/remove_early_progress_when_sc…
orklah Nov 13, 2023
7be610e
Doc typo
cgocast Nov 22, 2023
baa6d5d
Merge pull request #10393 from cgocast/doc
orklah Nov 22, 2023
edf9bbb
Merge remote-tracking branch 'origin/master'
danog Nov 26, 2023
9e53568
Merge remote-tracking branch 'origin/5.x' into HEAD
danog Nov 27, 2023
fa908e4
Fixes
danog Nov 27, 2023
851121b
Fix
danog Nov 27, 2023
af9649b
Improve scanning progress output
danog Nov 27, 2023
bd33348
Minor fixes
danog Nov 27, 2023
a84be64
Test
danog Nov 27, 2023
62ed2b0
Hotfix
danog Nov 27, 2023
d59a549
cs-fix
danog Nov 27, 2023
cd110d5
Cleanup
danog Nov 27, 2023
48f2430
Update baseline
danog Nov 27, 2023
2eed292
Fix
danog Nov 27, 2023
8d6174c
Fix
danog Nov 27, 2023
8058028
Fix
danog Nov 27, 2023
3238f4e
Merge branch 'origin_master'
danog Nov 27, 2023
3295f17
Merge pull request #10369 from nicelocal/origin_master
orklah Nov 27, 2023
af1b185
Merge branch 'master' into master
danog Nov 27, 2023
3b6ce27
Merge branch 'master' into improve_scan_progress
danog Nov 27, 2023
a3024ad
Merge pull request #10415 from nicelocal/improve_scan_progress
orklah Nov 27, 2023
626ec35
Inherit conditional returns
robchett Nov 8, 2023
083584d
TaintedExtract
cgocast Nov 22, 2023
c75e6da
Fix coding style
cgocast Nov 28, 2023
4c0d4f9
Merge branch 'master' into master
danog Nov 28, 2023
a88bf62
Tweak config
danog Nov 29, 2023
e0778fc
Fix parsing of array keys with @
danog Nov 29, 2023
efdf425
Merge pull request #10426 from nicelocal/fix_at_array_keys
orklah Nov 29, 2023
0e43c44
Merge pull request #10357 from robchett/inherit_conditional_function_…
orklah Nov 30, 2023
337c7af
Merge branch 'master' into master
danog Dec 3, 2023
a0b31c5
Fixed docblock spacing in supported_annotations.md `@psalm-internal` …
still-dreaming-1 Dec 7, 2023
f980689
Fix iteration over weakmaps
danog Dec 8, 2023
25be3c1
Fix
danog Dec 8, 2023
742052f
Merge pull request #10472 from nicelocal/fix_weakmap
orklah Dec 9, 2023
c6cddbe
Merge pull request #10467 from still-dreaming-1/patch-1
orklah Dec 9, 2023
a75d26a
Merge pull request #10417 from cgocast/tainted_extract
orklah Dec 10, 2023
9b82514
Merge remote-tracking branch 'vimeo/5.x' into HEAD
danog Dec 19, 2023
f1733c3
Merge branch 'merge_5.x'
danog Dec 19, 2023
456a5cd
Fixes
danog Dec 19, 2023
2fa024e
Fixes
danog Dec 19, 2023
c6c7649
Fixup
danog Dec 19, 2023
4dd06f7
Revert #10361
danog Jan 15, 2024
3f82312
Merge remote-tracking branch 'vimeo/5.x' into merge_5.x
danog Jan 15, 2024
c9fe76c
Patch
danog Jan 15, 2024
d12cdf6
Cleanup
danog Jan 15, 2024
556d24e
Update baseline
danog Jan 15, 2024
a032c6e
Ignore test issues bypassed by bypass-finals
danog Jan 15, 2024
3a263d2
Bump
danog Jan 15, 2024
adeca93
Bump
danog Jan 15, 2024
64868c5
Merge pull request #10504 from danog/merge_5.x
danog Jan 15, 2024
a1b8b3d
Merge remote-tracking branch 'vimeo/master'
danog Jan 15, 2024
645e59e
cs-fix
danog Jan 15, 2024
0504394
Fixup
danog Jan 17, 2024
4e5e306
Fixup
danog Jan 17, 2024
823c918
Fixup
danog Jan 17, 2024
950293c
Fixup test
danog Jan 17, 2024
11e2163
Update baseline
danog Jan 17, 2024
2a7d6d2
cs-fix
danog Jan 17, 2024
0ba0928
Try bumping PHP on windows CI
danog Jan 17, 2024
58c5598
Try disabling opcache
danog Jan 17, 2024
3411dd8
Skip opcache on windows
danog Jan 17, 2024
67c7be3
Merge pull request #10305 from nicelocal/master
danog Jan 17, 2024
d2c3f89
Do not use JIT on windows
danog Jan 17, 2024
0903574
Merge pull request #10564 from nicelocal/avoid_jit
danog Jan 17, 2024
aa40383
Let disable-extension also disable zend extensions
danog Jan 17, 2024
25fabb8
Merge pull request #10565 from nicelocal/avoid_jit
danog Jan 17, 2024
ded41fb
Merge remote-tracking branch 'vimeo/5.x' into HEAD
danog Jan 18, 2024
a2140cc
Merge pull request #10569 from nicelocal/merge_5.x
danog Jan 18, 2024
3c90054
Merge pull request #10576 from vimeo/5.x
danog Jan 19, 2024
917c5f8
Merge branch '5.x' into update-master
weirdan Jan 27, 2024
7701cd6
Remove unnecessary null type from `initialized_methods` Context property
theodorejb Jan 28, 2024
081fe2b
Optimize ConfigFileTest slightly
theodorejb Jan 28, 2024
275dfd8
Merge pull request #10610 from theodorejb/context-types
weirdan Jan 28, 2024
9520223
Merge pull request #10597 from weirdan/update-master
weirdan Jan 29, 2024
7a199c6
Merge branch '5.x' into update-master
weirdan Jan 30, 2024
e87fd86
Merge branch '5.x' into update-master
weirdan Jan 30, 2024
bf57d59
Merge pull request #10618 from weirdan/update-master
weirdan Jan 30, 2024
fc3e15d
Install php-parser 5.0
edsrzf Mar 8, 2023
1987309
Type-checking actually completes
edsrzf Mar 8, 2023
d51e394
Address parser changes to Throw
edsrzf Jan 8, 2024
c505d51
Update CustomTraverser traverseNode method
edsrzf Jan 8, 2024
087b1a1
Get inline assignment doc comment from statement
edsrzf Jan 9, 2024
e394609
Add suppressions
edsrzf Jan 9, 2024
4b38464
Replace deprecated constants
edsrzf Jan 9, 2024
8293da9
Fix CheckTrivialExprVisitor for ClosureUse
edsrzf Jan 10, 2024
662354e
Fix type for node attributes
edsrzf Jan 10, 2024
029ec43
Handle closure statements with docblocks
edsrzf Jan 11, 2024
8f7158f
Handle closures passed as arguments with docblocks
edsrzf Jan 12, 2024
3837c94
Remove impossible handleExpression condition
edsrzf Jan 12, 2024
4246586
Fix errors within php-parser
edsrzf Jan 12, 2024
beced71
Fix errors in SimpleNameResolver
edsrzf Jan 12, 2024
1e3f4e2
Remove unneeded pure suppressions
edsrzf Jan 12, 2024
6ca0043
Handle reference assignments with @var
edsrzf Jan 18, 2024
9577ff5
Remove unnecessary baseline suppression
edsrzf Jan 31, 2024
d916aa6
Merge pull request #10567 from edsrzf/php-parser-5
danog Feb 4, 2024
7bfdf7d
Merge branch '5.x' into update-master
weirdan Feb 5, 2024
49f5c99
Add missing strict_types
weirdan Feb 5, 2024
4b2c698
Merge pull request #10656 from weirdan/update-master
weirdan Feb 5, 2024
e8b73cd
Merge branch '5.x' into update-master
weirdan Feb 9, 2024
583e48a
CS fix
weirdan Feb 9, 2024
2ded7d0
Fixed test - Psalm now strips leading slash
weirdan Feb 9, 2024
89b6a15
Fix test on Windows
weirdan Feb 9, 2024
83f04c5
Update baseline
weirdan Feb 9, 2024
c03a8a0
Merge pull request #10684 from weirdan/update-master
weirdan Feb 9, 2024
80f443c
Suppress scanning output in CI
robchett Feb 10, 2024
6b27a6d
Merge pull request #10688 from robchett/suppress_scanning_output_in_ci
weirdan Feb 10, 2024
76c0262
Merge branch '5.x' into update-master
weirdan Feb 11, 2024
b3a44c5
Suppress unused config suppression detection when running in partial …
weirdan Feb 11, 2024
7995ad9
Fix composer warnings
weirdan Feb 11, 2024
177576c
Validate that all classes are autoloadable
weirdan Feb 11, 2024
5624533
Merge pull request #10695 from weirdan/fix-composer-warnings
weirdan Feb 11, 2024
1d53427
Merge pull request #10694 from weirdan/suppress-unused-suppression-de…
weirdan Feb 11, 2024
cb0e6a1
Merge pull request #10693 from weirdan/update-master
weirdan Feb 11, 2024
b36ad4f
Set ups default baseline file
jorgsowa Jan 24, 2024
c7fe47b
Fix wording
jorgsowa Jan 24, 2024
00fcbc1
PHPCS fix
jorgsowa Jan 24, 2024
10a53a2
Added test cases for generating baseline
jorgsowa Feb 11, 2024
dd985ca
Configure default baseline
jorgsowa Feb 11, 2024
e292b01
Break line
jorgsowa Feb 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 2 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
# See https://app.circleci.com/pipelines/github/vimeo/psalm
version: 2.1
executors:
php-74:
docker:
- image: thecodingmachine/php:7.4-v4-cli
php-80:
docker:
- image: thecodingmachine/php:8.0-v4-cli
php-81:
docker:
- image: thecodingmachine/php:8.1-v4-cli
Expand All @@ -16,7 +10,7 @@ executors:
- image: thecodingmachine/php:8.2-v4-cli
jobs:
"Code Style Analysis":
executor: php-74
executor: php-81
steps:
- checkout

Expand Down Expand Up @@ -44,7 +38,7 @@ jobs:
command: vendor/bin/phpcs -d memory_limit=512M

phar-build:
executor: php-74
executor: php-81
steps:
- attach_workspace:
at: /home/docker/project/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-phar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
tools: composer:v2
coverage: none
env:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
tools: composer:v2
coverage: none
env:
Expand All @@ -32,6 +32,12 @@ jobs:
env:
COMPOSER_ROOT_VERSION: dev-master

- name: Check all classes are autoloadable
run: |
composer dump-autoload -o --strict-psr
env:
COMPOSER_ROOT_VERSION: dev-master

- name: Cache composer cache
uses: actions/cache@v4
with:
Expand All @@ -57,7 +63,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
tools: composer:v2
coverage: none
env:
Expand Down Expand Up @@ -125,7 +131,6 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,21 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
php-version: '8.1'
#ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
ini-values: zend.assertions=1, assert.exception=1
tools: composer:v2
coverage: none
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, opcache, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
#extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, opcache, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter
env:
fail-fast: true

- name: PHP Version
run: |
php -v
php -r 'var_dump(PHP_VERSION_ID);'

- uses: actions/checkout@v4

- name: Get Composer Cache Directories
Expand Down
46 changes: 46 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,59 @@
# Upgrading from Psalm 5 to Psalm 6
## Changed

- The minimum PHP version was raised to PHP 8.1.17.

- [BC] The configuration settings `ignoreInternalFunctionFalseReturn` and `ignoreInternalFunctionNullReturn` are now defaulted to `false`

- [BC] Switched the internal representation of `list<T>` and `non-empty-list<T>` from the TList and TNonEmptyList classes to an unsealed list shape: the TList, TNonEmptyList and TCallableList classes were removed.
Nothing will change for users: the `list<T>` and `non-empty-list<T>` syntax will remain supported and its semantics unchanged.
Psalm 5 already deprecates the `TList`, `TNonEmptyList` and `TCallableList` classes: use `\Psalm\Type::getListAtomic`, `\Psalm\Type::getNonEmptyListAtomic` and `\Psalm\Type::getCallableListAtomic` to instantiate list atomics, or directly instantiate TKeyedArray objects with `is_list=true` where appropriate.

- [BC] The only optional boolean parameter of `TKeyedArray::getGenericArrayType` was removed, and was replaced with a string parameter with a different meaning.

- [BC] The `TDependentListKey` type was removed and replaced with an optional property of the `TIntRange` type.
-
- [BC] `TCallableArray` and `TCallableList` removed and replaced with `TCallableKeyedArray`.

- [BC] Class `Psalm\Issue\MixedInferredReturnType` was removed

- [BC] Value of constant `Psalm\Type\TaintKindGroup::ALL_INPUT` changed to reflect new `TaintKind::INPUT_EXTRACT`, `TaintKind::INPUT_SLEEP` and `TaintKind::INPUT_XPATH` have been added. Accordingly, default values for `$taint` parameters of `Psalm\Codebase::addTaintSource()` and `Psalm\Codebase::addTaintSink()` have been changed as well.

- [BC] Property `Config::$shepherd_host` was replaced with `Config::$shepherd_endpoint`

- [BC] Methods `Codebase::getSymbolLocation()` and `Codebase::getSymbolInformation()` were replaced with `Codebase::getSymbolLocationByReference()`

- [BC] Method `Psalm\Type\Atomic\TKeyedArray::getList()` was removed

- [BC] Method `Psalm\Storage\FunctionLikeStorage::getSignature()` was replaced with `FunctionLikeStorage::getCompletionSignature()`

- [BC] Property `Psalm\Storage\FunctionLikeStorage::$unused_docblock_params` was replaced with `FunctionLikeStorage::$unused_docblock_parameters`

- [BC] Method `Plugin\Shepherd::getCurlErrorMessage()` was removed

- [BC] Property `Config::$find_unused_code` changed default value from false to true

- [BC] Property `Config::$find_unused_baseline_entry` changed default value from false to true

- [BC] The return type of `Psalm\Internal\LanguageServer\ProtocolWriter#write() changed from `Amp\Promise` to `void` due to the switch to Amp v3

- [BC] All parameters, properties and return typehints are now strictly typed.

- [BC] `strict_types` is now applied to all files of the Psalm codebase.

- [BC] Properties `Psalm\Type\Atomic\TLiteralFloat::$value` and `Psalm\Type\Atomic\TLiteralInt::$value` became typed (`float` and `int` respectively)

- [BC] Property `Psalm\Storage\EnumCaseStorage::$value` changed from `int|string|null` to `TLiteralInt|TLiteralString|null`

- [BC] `Psalm\CodeLocation\Raw`, `Psalm\CodeLocation\ParseErrorLocation`, `Psalm\CodeLocation\DocblockTypeLocation`, `Psalm\Report\CountReport`, `Psalm\Type\Atomic\TNonEmptyArray` are now all final.

- [BC] `Psalm\Config` is now final.

- [BC] The return type of `Psalm\Plugin\ArgTypeInferer::infer` changed from `Union|false` to `Union|null`

- [BC] The `extra_types` property and `setIntersectionTypes` method of `Psalm\Type\Atomic\TTypeAlias` were removed.

- [BC] Methods `convertSeverity` and `calculateFingerprint` of `Psalm\Report\CodeClimateReport` were removed.

# Upgrading from Psalm 4 to Psalm 5
## Changed
Expand Down
2 changes: 2 additions & 0 deletions bin/generate_issues_list_doc.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env php
<?php

declare(strict_types=1);

$docs_dir = dirname(__DIR__) . DIRECTORY_SEPARATOR . "docs"
. DIRECTORY_SEPARATOR . "running_psalm" . DIRECTORY_SEPARATOR;
$issues_index = "{$docs_dir}issues.md";
Expand Down
2 changes: 2 additions & 0 deletions bin/generate_levels_doc.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Psalm\Config\IssueHandler;
use Psalm\Issue\CodeIssue;

Expand Down
4 changes: 3 additions & 1 deletion bin/generate_testsuites.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

if (count($argv) < 2) {
fwrite(STDERR, 'Usage: ' . $argv[0] . ' <number_of_chunks>' . PHP_EOL);
exit(1);
Expand Down Expand Up @@ -35,7 +37,7 @@
);
array_multisort($order, $files);

$chunks = array_chunk($files, ceil(count($files) / $number_of_chunks));
$chunks = array_chunk($files, (int) ceil(count($files) / $number_of_chunks));

$phpunit_config = new DOMDocument('1.0', 'UTF-8');
$phpunit_config->preserveWhiteSpace = false;
Expand Down
2 changes: 2 additions & 0 deletions bin/improve_class_alias.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

$vendor_path = 'vendor-bin/box/vendor/humbug/php-scoper/src/PhpParser/NodeVisitor/ClassAliasStmtAppender.php';

if (!file_exists($vendor_path)) {
Expand Down
2 changes: 2 additions & 0 deletions bin/max_used_shortcode.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env php
<?php

declare(strict_types=1);

use Psalm\Config\IssueHandler;

require_once(dirname(__DIR__) . '/vendor/autoload.php');
Expand Down
11 changes: 8 additions & 3 deletions bin/test-with-real-projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ collections)
git clone --depth=1 [email protected]:psalm/endtoend-test-collections.git
cd endtoend-test-collections
composer install
rm vendor/amphp/amp/lib/functions.php; touch vendor/amphp/amp/lib/functions.php;
rm vendor/amphp/amp/lib/Internal/functions.php; touch vendor/amphp/amp/lib/Internal/functions.php
rm vendor/amphp/byte-stream/lib/functions.php; touch vendor/amphp/byte-stream/lib/functions.php
"$PSALM" --monochrome --show-info=false
;;

Expand All @@ -36,11 +39,13 @@ psl)

git clone [email protected]:psalm/endtoend-test-psl.git
cd endtoend-test-psl
git checkout 2.3.x
git checkout 2.3.x_master
composer install
# Avoid conflicts with old psalm when running phar tests
rm -rf vendor/vimeo/psalm
sed 's/ErrorOutputBehavior::Packed, ErrorOutputBehavior::Discard/ErrorOutputBehavior::Discard/g' -i src/Psl/Shell/execute.php
"$PSALM" --monochrome -c config/psalm.xml
"$PSALM" --monochrome -c config/psalm.xml tests/static-analysis
"$PSALM_PHAR" --monochrome -c config/psalm.xml
"$PSALM_PHAR" --monochrome -c config/psalm.xml tests/static-analysis
;;

laravel)
Expand Down
6 changes: 3 additions & 3 deletions bin/update-property-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ function extractClassesFromStatements(array $statements): array
foreach ($files as $file) {
$contents = file_get_contents($file);
// FIXME: find a way to ignore custom entities, for now we strip them.
$contents = preg_replace('#&[a-zA-Z\d.\-_]+;#', '', $contents);
$contents = preg_replace('#%[a-zA-Z\d.\-_]+;#', '', $contents);
$contents = preg_replace('#<!ENTITY[^>]+>#', '', $contents);
$contents = (string) preg_replace('#&[a-zA-Z\d.\-_]+;#', '', $contents);
$contents = (string) preg_replace('#%[a-zA-Z\d.\-_]+;#', '', $contents);
$contents = (string) preg_replace('#<!ENTITY[^>]+>#', '', $contents);
try {
$simple = new SimpleXMLElement($contents);
} catch (Throwable $exception) {
Expand Down
27 changes: 13 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~8.1.17 || ~8.2.4 || ~8.3.0",
"ext-SimpleXML": "*",
"ext-ctype": "*",
"ext-dom": "*",
Expand All @@ -24,32 +24,30 @@
"ext-mbstring": "*",
"ext-tokenizer": "*",
"composer-runtime-api": "^2",
"amphp/amp": "^2.4.2",
"amphp/byte-stream": "^1.5",
"amphp/amp": "^3",
"amphp/byte-stream": "^2",
"composer/semver": "^1.4 || ^2.0 || ^3.0",
"composer/xdebug-handler": "^2.0 || ^3.0",
"dnoegel/php-xdg-base-dir": "^0.1.1",
"felixfbecker/advanced-json-rpc": "^3.1",
"felixfbecker/language-server-protocol": "^1.5.2",
"fidry/cpu-core-counter": "^0.4.1 || ^0.5.1 || ^1.0.0",
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
"nikic/php-parser": "^4.16",
"nikic/php-parser": "^5.0.0",
"sebastian/diff": "^4.0 || ^5.0 || ^6.0",
"spatie/array-to-xml": "^2.17.0 || ^3.0",
"symfony/console": "^4.1.6 || ^5.0 || ^6.0 || ^7.0",
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0"
},
"conflict": {
"nikic/php-parser": "4.17.0"
},
"provide": {
"psalm/psalm": "self.version"
},
"require-dev": {
"ext-curl": "*",
"amphp/phpunit-util": "^2.0",
"amphp/phpunit-util": "^3",
"bamarni/composer-bin-plugin": "^1.4",
"brianium/paratest": "^6.9",
"dg/bypass-finals": "^1.5",
"mockery/mockery": "^1.5",
"nunomaduro/mock-final-classes": "^1.1",
"php-parallel-lint/php-parallel-lint": "^1.2",
Expand Down Expand Up @@ -77,7 +75,8 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.x-dev",
"dev-master": "6.x-dev",
"dev-5.x": "5.x-dev",
"dev-4.x": "4.x-dev",
"dev-3.x": "3.x-dev",
"dev-2.x": "2.x-dev",
Expand Down Expand Up @@ -109,15 +108,15 @@
"lint": "@php parallel-lint ./src ./tests",
"phpunit": [
"Composer\\Config::disableProcessTimeout",
"@php paratest --runner=WrapperRunner"
"paratest -f --runner=WrapperRunner"
],
"phpunit-std": [
"Composer\\Config::disableProcessTimeout",
"@php phpunit"
],
"verify-callmap": "@php phpunit tests/Internal/Codebase/InternalCallMapHandlerTest.php",
"psalm": "@php ./psalm",
"psalm-set-baseline": "@php ./psalm --set-baseline=psalm-baseline.xml",
"psalm-set-baseline": "@php ./psalm --set-baseline",
"tests": [
"@lint",
"@cs",
Expand All @@ -135,8 +134,8 @@
"tests": "Runs all available tests."
},
"support": {
"docs": "https://psalm.dev/docs",
"issues": "https://github.com/vimeo/psalm/issues",
"source": "https://github.com/vimeo/psalm"
"docs": "https://psalm.dev/docs",
"issues": "https://github.com/vimeo/psalm/issues",
"source": "https://github.com/vimeo/psalm"
}
}
Loading
Loading