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

Bugfix: "TypeDoesNotContainNull: on return value from dom_import_simplexml" #7488

Closed
wants to merge 242 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
242 commits
Select commit Hold shift + click to select a range
e5b8a6e
TCallableString is non-falsy (0 can't be a functionlike name)
orklah Sep 22, 2021
2c70a1a
Use flag instead of `DirectoryIterator::isDot()`
dvz Dec 14, 2021
1da6893
Add `resolveSymlinks` condition for project directories
dvz Dec 14, 2021
daaa74c
Merge branch 'master' into explicit-symlink-resolution
dvz Dec 22, 2021
0f2ae28
Merge branch '4.x' into master
weirdan Jan 2, 2022
8d6b781
use consistent way to compare php version
orklah Nov 12, 2021
b41722e
Added 'release:removed' as a valid PR label
weirdan Jan 2, 2022
d3729c0
Document BC breaks
weirdan Jan 2, 2022
ba4a25b
Drop superfluous import
weirdan Jan 2, 2022
b419c29
Use InvalidScalarArgument only when we can be sure PHP attempts coercion
muglug Dec 19, 2021
ae00630
Add better documentation
muglug Dec 19, 2021
1e115da
Add better docs to TypeComparisonResult
muglug Dec 19, 2021
4f7c1d0
remove support for allowPhpstormGenerics
orklah Oct 20, 2021
48de574
remove support for allowPhpstormGenerics
orklah Oct 20, 2021
b658b27
remove exitFunctions
orklah Nov 3, 2021
3366eef
Merge branch '4.x' into master
weirdan Jan 2, 2022
2f50070
Merge pull request #6898 from orklah/php-version-consistency
weirdan Jan 3, 2022
0747b48
remove TEmpty
orklah Oct 13, 2021
2358b96
Fix merge errors
muglug Dec 15, 2021
83911c7
Remove unnecessary references to empty in TypeCombiner
muglug Dec 15, 2021
d912663
remove isEmpty
orklah Dec 16, 2021
13bb638
Drop remaining `Type::getEmpty()` references
weirdan Jan 2, 2022
44fbb9f
s/array<empty, empty>/array<never, never>/g
weirdan Jan 3, 2022
1bb2661
Update TAssertionEmpty signatures
weirdan Jan 3, 2022
fe02697
Merge pull request #6662 from orklah/remove-empty
weirdan Jan 3, 2022
f19e4ce
Merge pull request #6705 from orklah/phpstorm-generics-removal
weirdan Jan 3, 2022
966b6ae
Merge pull request #6808 from orklah/exitFunctions3
weirdan Jan 3, 2022
ab60d31
Merge pull request #7188 from vimeo/muglug-use-invalidscalarargument-…
weirdan Jan 3, 2022
c3700e1
Updated UPGRADING.md
weirdan Jan 3, 2022
1c15a6a
Disable PSL as not yet compatible with Psalm 5
weirdan Jan 3, 2022
ec023f4
Merge pull request #7269 from weirdan/disable-psl
weirdan Jan 3, 2022
b54ab67
Require `@internal` annotation on `Psalm\Internal` symbols
weirdan Jan 3, 2022
b924032
Mark internal classes `@internal`
weirdan Jan 3, 2022
2066a21
Documented addition of `@internal` annotations
weirdan Jan 3, 2022
e157a6e
Merge pull request #7268 from weirdan/internal-is-internal
weirdan Jan 3, 2022
706f2a7
Drop legacy procedural files
weirdan Jan 3, 2022
b8bad62
Merge pull request #7270 from weirdan/drop-legacy-binaries
weirdan Jan 3, 2022
55eb4b0
Dropped removed config entries
weirdan Jan 3, 2022
0dba2a6
Merge pull request #7272 from weirdan/drop-deprecated-config-entries
weirdan Jan 3, 2022
2e24a16
Dropped legacy plugin API
weirdan Jan 3, 2022
0a991e3
Documented removal of legacy hook interfaces
weirdan Jan 3, 2022
bcff8d9
Merge pull request #7275 from weirdan/drop-legacy-api
weirdan Jan 3, 2022
ba69f4f
Dropped deprecated `CodeIssue` methods
weirdan Jan 3, 2022
0866866
Document CodeIssue methods removal
weirdan Jan 3, 2022
af7501f
Merge pull request #7276 from weirdan/drop-deprecated-codeissue-methods
weirdan Jan 3, 2022
401c2e9
Dropped deprecated TypeAnalyzer methods
weirdan Jan 3, 2022
dd0765a
Merge pull request #7277 from weirdan/drop-deprecated-typeanalyzer-me…
weirdan Jan 3, 2022
e04d545
Dropped deprecated `DocComment` methods
weirdan Jan 3, 2022
804d0c6
Documented DocComment methods removal
weirdan Jan 3, 2022
21fc7a7
Merge pull request #7278 from weirdan/drop-deprecated-doccomment-methods
weirdan Jan 3, 2022
988ae94
Trim baseline selection
weirdan Jan 3, 2022
4c84745
Merge pull request #7279 from weirdan/trim-existing-issue-selections
weirdan Jan 3, 2022
dbee118
Moved `getPsalmHelpText()` to `Cli\Psalm`
weirdan Jan 3, 2022
7d6324a
Merge pull request #7280 from weirdan/move-help-text
weirdan Jan 3, 2022
e6472de
Dropped `html-escaped-string` docs
weirdan Jan 3, 2022
87977e4
Merge pull request #7281 from weirdan/drop-htl-escaped-string-docs
weirdan Jan 3, 2022
c1acab4
Merge branch '4.x' into upstream-master
weirdan Jan 3, 2022
afa6497
Dropped `THtmlEscapedString`
weirdan Jan 3, 2022
f09814a
Documented THtmlEscapedString removal
weirdan Jan 3, 2022
c2c3247
Merge pull request #7285 from weirdan/drop-html-escaped-string
weirdan Jan 3, 2022
ff9b214
Merge branch '4.x' into upstream-master
weirdan Jan 4, 2022
30013cb
Drop orphaned token
weirdan Jan 4, 2022
3869d83
Merge pull request #7290 from weirdan/drop-mysql-escaped-string
weirdan Jan 4, 2022
fa33632
Bump PHP version to 7.4
weirdan Jan 4, 2022
20567ff
Remove the polyfill we no longer need
weirdan Jan 4, 2022
cf962ee
Promote conditional tests to always-running
weirdan Jan 4, 2022
d227cb5
Tighten dependency ranges
weirdan Jan 4, 2022
c844079
Merge pull request #7291 from weirdan/bump-php-version
weirdan Jan 4, 2022
02b91cc
Replaced deprecated webmozart/path-util
weirdan Jan 4, 2022
f40e6df
Merge pull request #7292 from weirdan/replace-webmozart-pathutils
weirdan Jan 4, 2022
2c6d4f8
Fix erroneous intersection
muglug Jan 4, 2022
0fffb55
Simplify some logic around negations to prevent unecessary looping
muglug Jan 4, 2022
4e81d0c
Remove an untested chunk of issue-triggering code that has only ever …
muglug Jan 4, 2022
63f3460
Make clear that class string check for trait $this key only applies t…
muglug Jan 4, 2022
f5dc2ee
Merge branch '4.x' into upstream-master
weirdan Jan 4, 2022
0c13d8e
Indent heredoc
weirdan Jan 4, 2022
0cbce39
Merge pull request #7294 from weirdan/indent-heredoc
weirdan Jan 4, 2022
5758d31
Apply literal number separator rector
weirdan Jan 4, 2022
9e64375
Break up two intersection methods
muglug Jan 4, 2022
0a78b32
Remove commas for now
muglug Jan 4, 2022
5e22026
Fix version id for the callable object typehint
weirdan Jan 4, 2022
c81c5fa
Drop dead code based on PHP_VERSION_ID
weirdan Jan 4, 2022
26de4fa
Unify names with intersection creation
muglug Jan 5, 2022
31dd30f
Reduce by-ref args
muglug Jan 5, 2022
7595a3c
Make treatment of interfaces and classes more symmetrical
muglug Jan 5, 2022
f5d6d23
Remove now-unnecessary code
muglug Jan 5, 2022
d30d527
Ensure separator is used for long numbers
weirdan Jan 5, 2022
9b488e6
Merge pull request #7300 from weirdan/dead-code-phpversion
weirdan Jan 5, 2022
758e0af
Merge branch 'master' into rector-literal-number-separator
weirdan Jan 5, 2022
0f84dd3
Merge pull request #7299 from weirdan/rector-literal-number-separator
weirdan Jan 5, 2022
dd09450
Applied NullCoalescingOperatorRector
weirdan Jan 5, 2022
dfb14cb
Enforce null-coalesce operators
weirdan Jan 5, 2022
2bc7b9b
Merge pull request #7302 from weirdan/rector-null-coalescing-operator
weirdan Jan 5, 2022
94395f1
Applied JsonThrowOnErrorRector
weirdan Jan 5, 2022
b8240e2
Merge pull request #7303 from weirdan/rector-json-exceptions
weirdan Jan 5, 2022
83f1d52
Applied ListToArrayDestructRector
weirdan Jan 5, 2022
e4c16c1
Enforce `[...]` usage instead of `list(...)`
weirdan Jan 5, 2022
17793d1
Merge pull request #7310 from weirdan/rector-ListToArrayDestructRector
weirdan Jan 5, 2022
030195a
parse array{} into an empty array
orklah Jan 4, 2022
9d3a51d
remove obsolete test and fix a missing exception
orklah Jan 5, 2022
3c468b3
replace `array<never, never>` as a way to detect empty arrays by a de…
orklah Jan 5, 2022
ee99dea
fix a case not always on TArray
orklah Jan 5, 2022
7f40489
fix inverted condition
orklah Jan 5, 2022
8726065
Applied ClosureToArrowFunctionRector
weirdan Jan 5, 2022
bf4bf92
Merge pull request #7313 from orklah/empty-arrays
orklah Jan 5, 2022
638a10d
Restore return docblock
weirdan Jan 5, 2022
b6559dc
Merge pull request #7315 from weirdan/rector-ClosureToArrowFunctionRe…
weirdan Jan 6, 2022
f3bc55e
Merge pull request #7312 from orklah/empty-array
orklah Jan 6, 2022
3fb3db3
Merge branch '4.x' into upstream-master
weirdan Jan 6, 2022
762ef8d
Merge branch '4.x' into upstream-master
weirdan Jan 7, 2022
4abbd9c
Simplify object comparison
muglug Jan 7, 2022
b941078
Merge pull request #7340 from vimeo/muglug-simplify-object-comparison
orklah Jan 8, 2022
1a1b5a9
Merge branch '4.x' into upstream-master
weirdan Jan 8, 2022
6f513df
Fix empty class
muglug Jan 9, 2022
a435bc5
Rename was_static property to is_static to be more accurate
muglug Jan 9, 2022
e1e3839
Merge pull request #7358 from vimeo/muglug-what-was-is-is
orklah Jan 9, 2022
7dc1c45
Don’t perform containedness check twice
muglug Jan 9, 2022
6589ad1
Document BC breaks in #7358
weirdan Jan 9, 2022
72fd3de
Simplify return type for TypeExpander::expandAtomic
muglug Jan 9, 2022
206332b
Merge pull request #7360 from weirdan/document-7358
weirdan Jan 9, 2022
d52c3f0
Merge pull request #7163 from dvz/explicit-symlink-resolution
orklah Jan 10, 2022
9f9573a
Remove an unnecessary null arg
muglug Jan 11, 2022
99b7b46
Simplify some array access
muglug Jan 13, 2022
f439d65
Ensure that all entries in test arrays have explicit keys (#7386)
muglug Jan 13, 2022
b49682a
Simplify issue suppression in tests
muglug Jan 13, 2022
58b567a
Fix test
muglug Jan 13, 2022
0ded59d
Remove unused use
muglug Jan 14, 2022
9ac77e9
Merge pull request #6521 from orklah/callable-non-falsy
orklah Jan 14, 2022
b633619
Merge remote-tracking branch 'upstream/4.x' into upstream-master
orklah Jan 14, 2022
d2faa5b
fix errors after merge
orklah Jan 14, 2022
b3e7f12
Prevent NoValue when there is no phpdoc
orklah Jan 14, 2022
1f0d3de
Merge pull request #7399 from orklah/testnever2
orklah Jan 14, 2022
dd8df37
Remove never-used assertion check
muglug Jan 15, 2022
5b82082
Merge remote-tracking branch 'upstream/4.x' into upstream-master2
orklah Jan 15, 2022
e8c8161
fix merge induced errors
orklah Jan 15, 2022
9190294
Make test more of a real-world example
muglug Jan 16, 2022
26dd4c5
Try to provide literal int types when possible (fixes #6966) (#7071)
ricardoboss Jan 16, 2022
e1d2da7
More specific test name
muglug Jan 16, 2022
00ce110
Infer partially applied closure arg by previous function arg
klimick Jan 18, 2022
cce1f9a
Some refactoring and doc for high order function argument handling
klimick Jan 18, 2022
fac7115
Add simple test for high order function arg inference
klimick Jan 18, 2022
6f9b6f8
Fix psalm issues
klimick Jan 18, 2022
3886d5b
Add test for high order function arg inference in class context
klimick Jan 18, 2022
a0bda86
Rename method
klimick Jan 18, 2022
ffdf97c
Remove unused function
klimick Jan 18, 2022
12648f4
Comments for describe how works higher order func arg inference
klimick Jan 18, 2022
6e1957e
Support higher order func arg inference for static and instance calls
klimick Jan 18, 2022
379d0d6
Add tests
klimick Jan 18, 2022
5f749c8
remove forbidEcho
orklah Jan 18, 2022
dceaa11
remove forbidEcho
orklah Jan 18, 2022
ddf7a0b
remove forbidEcho
orklah Jan 18, 2022
477c011
Merge remote-tracking branch 'upstream/4.x' into upstream-master3
orklah Jan 18, 2022
fca72ee
Fix psalm issues
klimick Jan 18, 2022
7e623ed
Upcast invokable to callable during hof arg analysis
klimick Jan 18, 2022
5fb1df8
Fix psalm issues in CallableTypeComparator
klimick Jan 18, 2022
cb976f8
fix merge induced errors
orklah Jan 18, 2022
1c3d15f
Added documentation for baseline files
ricardoboss Jan 19, 2022
bd1385d
Added context for updating the baseline files
ricardoboss Jan 19, 2022
ae954f0
Update dealing_with_code_issues.md
ricardoboss Jan 19, 2022
4e57110
Merge pull request #7429 from ricardoboss/update-baseline-docs
orklah Jan 19, 2022
5a6dccd
Merge pull request #7420 from orklah/remove-old-things
orklah Jan 19, 2022
ac858e3
create a return type provider for mb_internal_encoding
orklah Jan 19, 2022
1b8f337
Allow psalm to load threads from the config
M1ke Jan 20, 2022
2fdae4a
Use config threads if lower than detected threads
M1ke Jan 20, 2022
df48eab
Add new config item to docs
M1ke Jan 20, 2022
0dc4249
Fix phpcs
M1ke Jan 20, 2022
06aafa7
Wording for threads config doc
M1ke Jan 20, 2022
6107148
Alter order of precedence and upated docs to match
M1ke Jan 20, 2022
473631f
Remove unused & untested code in AlgebraAnalyzer
muglug Jan 20, 2022
7047944
Remove untested likely-unnecessary code
muglug Jan 20, 2022
1ff3161
Remove array_unique call
muglug Jan 20, 2022
2aeaade
Merge pull request #7442 from M1ke/m1ke/config-threads
orklah Jan 20, 2022
2f052a8
Merge pull request #7437 from orklah/mb_internal_encoding
orklah Jan 20, 2022
6f1a5e8
Merge pull request #7417 from klimick/partially-applied-closure-infer…
orklah Jan 20, 2022
eb53f7e
fix tests
orklah Jan 20, 2022
65783c7
Merge pull request #7446 from orklah/fix-ci2
orklah Jan 20, 2022
0a81f8c
Use objects, not strings, for assertions (#7410)
muglug Jan 20, 2022
fe9d3f0
nitpicks
orklah Jan 20, 2022
f9e3923
remove unused imports
orklah Jan 20, 2022
831f14d
Merge pull request #7448 from orklah/nitpick
orklah Jan 20, 2022
f9b26ac
Array key exists assert both ways
orklah Jan 20, 2022
35577df
fix typo
orklah Jan 20, 2022
f6369dc
Merge pull request #7449 from orklah/7415-2
orklah Jan 20, 2022
a3bdf1b
feat: Handle native intersection types
petewalker Jan 21, 2022
6b789bb
[TypeProvider] Provide argument types during FunctionParamsProviderEvent
veewee Jan 21, 2022
142b85a
Merge pull request #7394 from veewee/function-params-provider-improve…
orklah Jan 21, 2022
299eca4
fix: Add PHP version checks / more tests
petewalker Jan 21, 2022
e2ebfd2
Trigger CI
petewalker Jan 21, 2022
41a3807
fix: Lint issue
petewalker Jan 21, 2022
057a99c
fix: Tests / minor bug
petewalker Jan 22, 2022
be6ce77
chore: Better exception messages
petewalker Jan 22, 2022
d1a946c
Merge pull request #7454 from petewalker/feat/native-intersections
orklah Jan 22, 2022
af1888b
Merge remote-tracking branch 'upstream/4.x' into upstream-master4
orklah Jan 22, 2022
070a1cc
fix merge induced errors
orklah Jan 22, 2022
841d4f4
improve support for enum_exists
orklah Jan 16, 2022
4ed8355
Merge pull request #7404 from orklah/enum_exists
orklah Jan 22, 2022
0e891f2
refactor description of types in Atomic
orklah Jan 16, 2022
39052d9
Merge pull request #7409 from orklah/cleanup-types
orklah Jan 22, 2022
2f2c24c
Add reproducer for stub parent class not being loaded.
AndrolGenhald Dec 9, 2021
db67d2c
Add support for checking parent classes and interfaces from stubs.
AndrolGenhald Dec 9, 2021
c24cf9a
Add test for circular reference with stub class.
AndrolGenhald Dec 9, 2021
2262cb6
Check for circular references with stubbed classes.
AndrolGenhald Dec 9, 2021
9a064c0
Fix invalid trailing comma.
AndrolGenhald Dec 9, 2021
3510f55
Check for indirect circular dependencies with stubbed parents.
AndrolGenhald Dec 14, 2021
b965545
fix code where the offset was wrong
orklah Jan 22, 2022
0c142ee
Add BC break note.
AndrolGenhald Jan 22, 2022
2d8ef78
remove files that were wrongly reintroduced
orklah Jan 22, 2022
c3ad520
Merge pull request #7110 from AndrolGenhald/bugfix/stub-parent-class
orklah Jan 22, 2022
e0d3c3f
Merge pull request #7463 from orklah/Properties
orklah Jan 22, 2022
c18a155
Support type annotations for class consts (fixes #942).
AndrolGenhald Jan 20, 2022
df31465
Fix trailing comma.
AndrolGenhald Jan 20, 2022
c877ce0
Use inferred type instead of annotated type where possible.
AndrolGenhald Jan 20, 2022
558208e
Add type checking for class const assignments, fix several other cons…
AndrolGenhald Jan 20, 2022
0fb0632
Infer type from known ternary condition.
AndrolGenhald Jan 20, 2022
c61bde8
Suppress PossiblyUnusedProperty, will be used in the future.
AndrolGenhald Jan 20, 2022
1686f28
Default to using inferred type unless in late static binding context.
AndrolGenhald Jan 20, 2022
7d25697
Fix cs/psalm errors after rebase.
AndrolGenhald Jan 20, 2022
0fe2f6f
Refactor existing method to reduce redundant code.
AndrolGenhald Jan 22, 2022
1f1f1c5
Fix CS issue due to rebase.
AndrolGenhald Jan 22, 2022
865a9f8
Remove nullability from properties that don’t need them
muglug Jan 23, 2022
7014242
reconcile two arrays by combining them
orklah Jan 23, 2022
5e41e14
Merge pull request #7470 from orklah/array_is_list2
orklah Jan 23, 2022
a7b72b8
remove TPositiveInt usage for TIntRange
orklah Jan 23, 2022
c90cffd
Merge pull request #7472 from orklah/intrange
orklah Jan 23, 2022
7c4f080
Merge remote-tracking branch 'upstream/4.x' into upstream-master5
orklah Jan 23, 2022
63b802b
remove TPositiveInt
orklah Jan 23, 2022
42d2e2d
update baseline
orklah Jan 23, 2022
8a52903
Merge pull request #7473 from orklah/intrange2
orklah Jan 23, 2022
ab2b77d
Fix unnecessary array merge
muglug Jan 24, 2022
c7d938b
Remove unnecessary code in Context::removeDescendants
muglug Jan 24, 2022
944b281
Prevent negation from removing unmatched template vars
muglug Jan 24, 2022
8ee10ef
Fix indentation
muglug Jan 24, 2022
61d450a
Fix combination of templated types
muglug Jan 24, 2022
18f5446
Remove unnecessary hack embedding IfScope in Context object
muglug Jan 24, 2022
c974f23
Simplify context references
muglug Jan 24, 2022
302c72d
Add a couple of currently-working tests
muglug Jan 25, 2022
8ab0eec
Fix key
muglug Jan 25, 2022
7c8441b
Merge pull request #7123 from AndrolGenhald/feature/942-type-annotate…
orklah Jan 25, 2022
204d09b
fix error with 0 being considered positive
orklah Jan 25, 2022
1cc9d1c
Merge pull request #7487 from orklah/error
orklah Jan 25, 2022
557b1f4
Added the change to the delta callmap
KevinVanSonsbeek Jan 25, 2022
ec12c08
Updated the CallMap to have the correct return type for the dom_impor…
KevinVanSonsbeek Jan 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ jobs:
- run:
name: Analyse PHPUnit
command: bin/test-with-real-projects.sh phpunit
# PSL requires its own plugin that is not yet compatible with Psalm 5
# - run:
# name: Analyse Psl
# command: bin/test-with-real-projects.sh psl
- run:
name: Analyse Collections
command: bin/test-with-real-projects.sh collections
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.1'
php-version: '7.4'
tools: composer:v2
coverage: none

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
with:
mode: minimum
count: 1
labels: "release:typo, release:fix, release:feature, release:deprecation, release:internal, release:docs"
labels: "release:typo, release:fix, release:feature, release:deprecation, release:internal, release:docs, release:removed"
166 changes: 166 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# Upgrading from Psalm 4 to Psalm 5
## Changed
- [BC] TPositiveInt has been removed and replaced by TIntRange

- [BC] The parameter `$php_version` of `Psalm\Type\Atomic::create()` renamed
to `$analysis_php_version_id` and changed from `array|null` to `int|null`.
Previously it accepted PHP version as `array{major_version, minor_version}`
while now it accepts version ID, similar to how [`PHP_VERSION_ID` is
calculated](https://www.php.net/manual/en/reserved.constants.php#constant.php-version-id).

- [BC] The parameter `$php_version` of `Psalm\Type::parseString()` renamed to
`$analysis_php_version_id` and changed from `array|null` to `int|null`.
Previously it accepted PHP version as `array{major_version, minor_version}`
while now it accepts version ID.

- [BC] Parameter 0 of `canBeFullyExpressedInPhp()` of the classes listed below
changed name from `php_major_version` to `analysis_php_version_id`.
Previously it accepted major PHP version as int (e.g. `7`), while now it
accepts version ID. Classes affected:
- `Psalm\Type\Atomic`
- `Psalm\Type\Atomic\Scalar`
- `Psalm\Type\Atomic\TArray`
- `Psalm\Type\Atomic\TArrayKey`
- `Psalm\Type\Atomic\TCallable`
- `Psalm\Type\Atomic\TCallableObject`
- `Psalm\Type\Atomic\TCallableString`
- `Psalm\Type\Atomic\TClassConstant`
- `Psalm\Type\Atomic\TClassString`
- `Psalm\Type\Atomic\TClassStringMap`
- `Psalm\Type\Atomic\TClosedResource`
- `Psalm\Type\Atomic\TClosure`
- `Psalm\Type\Atomic\TConditional`
- `Psalm\Type\Atomic\TDependentGetClass`
- `Psalm\Type\Atomic\TDependentGetDebugType`
- `Psalm\Type\Atomic\TDependentGetType`
- `Psalm\Type\Atomic\TDependentListKey`
- `Psalm\Type\Atomic\TEnumCase`
- `Psalm\Type\Atomic\TFalse`
- `Psalm\Type\Atomic\TGenericObject`
- `Psalm\Type\Atomic\TIntMask`
- `Psalm\Type\Atomic\TIntMaskOf`
- `Psalm\Type\Atomic\TIntRange`
- `Psalm\Type\Atomic\TIterable`
- `Psalm\Type\Atomic\TKeyedArray`
- `Psalm\Type\Atomic\TKeyOfClassConstant`
- `Psalm\Type\Atomic\TList`
- `Psalm\Type\Atomic\TLiteralClassString`
- `Psalm\Type\Atomic\TLowercaseString`
- `Psalm\Type\Atomic\TMixed`
- `Psalm\Type\Atomic\TNamedObject`
- `Psalm\Type\Atomic\TNever`
- `Psalm\Type\Atomic\TNonEmptyLowercaseString`
- `Psalm\Type\Atomic\TNonspecificLiteralInt`
- `Psalm\Type\Atomic\TNonspecificLiteralString`
- `Psalm\Type\Atomic\TNull`
- `Psalm\Type\Atomic\TNumeric`
- `Psalm\Type\Atomic\TNumericString`
- `Psalm\Type\Atomic\TObject`
- `Psalm\Type\Atomic\TObjectWithProperties`
- `Psalm\Type\Atomic\TResource`
- `Psalm\Type\Atomic\TScalar`
- `Psalm\Type\Atomic\TTemplateIndexedAccess`
- `Psalm\Type\Atomic\TTemplateParam`
- `Psalm\Type\Atomic\TTraitString`
- `Psalm\Type\Atomic\TTrue`
- `Psalm\Type\Atomic\TTypeAlias`
- `Psalm\Type\Atomic\TValueOfClassConstant`
- `Psalm\Type\Atomic\TVoid`
- `Psalm\Type\Union`

- [BC] Parameter 3 of `toPhpString()` of methods listed below changed name
from `php_major_version` to `analysis_php_version_id`. Previously it
accepted major PHP version as int (e.g. `7`), while now it accepts version
ID. Classes affected:
- `Psalm\Type\Atomic`
- `Psalm\Type\Atomic\CallableTrait`
- `Psalm\Type\Atomic\TAnonymousClassInstance`
- `Psalm\Type\Atomic\TArray`
- `Psalm\Type\Atomic\TArrayKey`
- `Psalm\Type\Atomic\TBool`
- `Psalm\Type\Atomic\TCallable`
- `Psalm\Type\Atomic\TCallableObject`
- `Psalm\Type\Atomic\TClassConstant`
- `Psalm\Type\Atomic\TClassString`
- `Psalm\Type\Atomic\TClassStringMap`
- `Psalm\Type\Atomic\TClosedResource`
- `Psalm\Type\Atomic\TConditional`
- `Psalm\Type\Atomic\TEmpty`
- `Psalm\Type\Atomic\TEnumCase`
- `Psalm\Type\Atomic\TFloat`
- `Psalm\Type\Atomic\TGenericObject`
- `Psalm\Type\Atomic\TInt`
- `Psalm\Type\Atomic\TIterable`
- `Psalm\Type\Atomic\TKeyedArray`
- `Psalm\Type\Atomic\TKeyOfClassConstant`
- `Psalm\Type\Atomic\TList`
- `Psalm\Type\Atomic\TLiteralClassString`
- `Psalm\Type\Atomic\TMixed`
- `Psalm\Type\Atomic\TNamedObject`
- `Psalm\Type\Atomic\TNever`
- `Psalm\Type\Atomic\TNull`
- `Psalm\Type\Atomic\TNumeric`
- `Psalm\Type\Atomic\TObject`
- `Psalm\Type\Atomic\TObjectWithProperties`
- `Psalm\Type\Atomic\TResource`
- `Psalm\Type\Atomic\TScalar`
- `Psalm\Type\Atomic\TString`
- `Psalm\Type\Atomic\TTemplateIndexedAccess`
- `Psalm\Type\Atomic\TTemplateParam`
- `Psalm\Type\Atomic\TTraitString`
- `Psalm\Type\Atomic\TTypeAlias`
- `Psalm\Type\Atomic\TValueOfClassConstant`
- `Psalm\Type\Atomic\TVoid`
- `Psalm\Type\Union`
- While not a BC break per se, all classes / interfaces / traits / enums under
`Psalm\Internal` namespace are now marked `@internal`.
- [BC] Parameter 1 of `Psalm\Type\Atomic\TNamedObject::__construct()` changed name from `was_static` to `is_static`
- [BC] Parameter 1 of `Psalm\Type\Atomic\TAnonymousClassInstance::__construct()` changed name from `was_static` to `is_static`
- [BC] Parameter 5 of `Psalm\Type::getStringFromFQCLN()` changed name from `was_static` to `is_static`
- [BC] Property `Psalm\Type\Atomic\TNamedObject::$was_static` was renamed to `$is_static`
- [BC] Method `Psalm\Type\Union::isFormerStaticObject()` was renamed to `isStaticObject()`
- [BC] Method `Psalm\Type\Union::hasFormerStaticObject()` was renamed to `hasStaticObject()`
- [BC] Function assertions (from `@psalm-assert Foo $bar`) have been converted from strings to specific `Assertion` objects.
- [BC] Property `Psalm\Storage\ClassLikeStorage::$invalid_dependencies` changed from `array<string>` to `array<string, true>`.

## Removed
- [BC] Property `Psalm\Codebase::$php_major_version` was removed, use
`Psalm\Codebase::$analysis_php_version_id`.
- [BC] Property `Psalm\Codebase::$php_minor_version` was removed, use
`Psalm\Codebase::$analysis_php_version_id`.
- [BC] Class `Psalm\Type\Atomic\TEmpty` was removed
- [BC] Method `Psalm\Type\Union::isEmpty()` was removed
- [BC] Property `Psalm\Config::$allow_phpstorm_generics` was removed
- [BC] Property `Psalm\Config::$exit_functions` was removed
- [BC] Property `Psalm\Config::$forbid_echo` was removed
- [BC] Method `Psalm\Type::getEmpty()` was removed
- [BC] Legacy hook interfaces have been removed:
- `Psalm\Plugin\Hook\MethodReturnTypeProviderInterface`
- `Psalm\Plugin\Hook\BeforeFileAnalysisInterface`
- `Psalm\Plugin\Hook\AfterFileAnalysisInterface`
- `Psalm\Plugin\Hook\AfterMethodCallAnalysisInterface`
- `Psalm\Plugin\Hook\AfterClassLikeVisitInterface`
- `Psalm\Plugin\Hook\StringInterpreterInterface`
- `Psalm\Plugin\Hook\AfterExpressionAnalysisInterface`
- `Psalm\Plugin\Hook\AfterEveryFunctionCallAnalysisInterface`
- `Psalm\Plugin\Hook\PropertyExistenceProviderInterface`
- `Psalm\Plugin\Hook\AfterFunctionLikeAnalysisInterface`
- `Psalm\Plugin\Hook\FunctionParamsProviderInterface`
- `Psalm\Plugin\Hook\FunctionReturnTypeProviderInterface`
- `Psalm\Plugin\Hook\FunctionExistenceProviderInterface`
- `Psalm\Plugin\Hook\AfterAnalysisInterface`
- `Psalm\Plugin\Hook\MethodVisibilityProviderInterface`
- `Psalm\Plugin\Hook\MethodParamsProviderInterface`
- `Psalm\Plugin\Hook\AfterClassLikeExistenceCheckInterface`
- `Psalm\Plugin\Hook\PropertyTypeProviderInterface`
- `Psalm\Plugin\Hook\AfterFunctionCallAnalysisInterface`
- `Psalm\Plugin\Hook\MethodExistenceProviderInterface`
- `Psalm\Plugin\Hook\AfterCodebasePopulatedInterface`
- `Psalm\Plugin\Hook\AfterClassLikeAnalysisInterface`
- `Psalm\Plugin\Hook\PropertyVisibilityProviderInterface`
- `Psalm\Plugin\Hook\AfterStatementAnalysisInterface`
- [BC] Method `Psalm\Issue\CodeIssue::getLocation()` was removed
- [BC] Method `Psalm\Issue\CodeIssue::getFileName()` was removed
- [BC] Method `Psalm\Issue\CodeIssue::getMessage()` was removed
- [BC] Method `Psalm\DocComment::parse()` was removed
- [BC] Class `Psalm\Type\Atomic\THtmlEscapedString` has been removed
20 changes: 8 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": "^7.1|^8",
"php": "^7.4 || ~8.0.0 || ~8.1.0",
"ext-SimpleXML": "*",
"ext-ctype": "*",
"ext-dom": "*",
Expand All @@ -28,30 +28,30 @@
"composer/semver": "^1.4 || ^2.0 || ^3.0",
"composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0",
"dnoegel/php-xdg-base-dir": "^0.1.1",
"felixfbecker/advanced-json-rpc": "^3.0.3",
"felixfbecker/advanced-json-rpc": "^3.1",
"felixfbecker/language-server-protocol": "^1.5",
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
"nikic/php-parser": "^4.13",
"openlss/lib-array2xml": "^1.0",
"sebastian/diff": "^3.0 || ^4.0",
"sebastian/diff": "^4.0",
"symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0",
"webmozart/path-util": "^2.3"
"symfony/filesystem": "^5.4 || ^6.0"
},
"provide": {
"psalm/psalm": "self.version"
},
"require-dev": {
"ext-curl": "*",
"bamarni/composer-bin-plugin": "^1.2",
"bamarni/composer-bin-plugin": "^1.4",
"brianium/paratest": "^4.0||^6.0",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpdocumentor/reflection-docblock": "^5",
"phpmyadmin/sql-parser": "5.1.0||dev-master",
"phpspec/prophecy": ">=1.9.0",
"phpspec/prophecy": ">=1.10.2",
"phpunit/phpunit": "^9.0",
"psalm/plugin-phpunit": "^0.16",
"slevomat/coding-standard": "^7.0",
"squizlabs/php_codesniffer": "^3.5",
"squizlabs/php_codesniffer": "^3.6",
"symfony/process": "^4.3 || ^5.0 || ^6.0",
"weirdan/prophecy-shim": "^1.0 || ^2.0"
},
Expand Down Expand Up @@ -80,11 +80,7 @@
"autoload": {
"psr-4": {
"Psalm\\": "src/Psalm/"
},
"files": [
"src/functions.php",
"src/spl_object_id.php"
]
}
},
"autoload-dev": {
"psr-4": {
Expand Down
55 changes: 21 additions & 34 deletions config.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
<xs:element name="mockClasses" type="MockClassesType" minOccurs="0" maxOccurs="1" />
<xs:element name="stubs" type="StubsType" minOccurs="0" maxOccurs="1" />
<xs:element name="plugins" type="PluginsType" minOccurs="0" maxOccurs="1" />
<xs:element name="exitFunctions" type="ExitFunctionsType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<!-- note: for PHPStorm to mark the attribute as deprecated the doc entry has to be *single line* and start with the word `deprecated` -->
<xs:documentation xml:lang="en">
Deprecated. Replaced by documenting never as a return type. It is going to be removed in Psalm 5.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="forbiddenFunctions" type="ExitFunctionsType" minOccurs="0" maxOccurs="1" />
<xs:element name="issueHandlers" type="IssueHandlersType" minOccurs="0" maxOccurs="1" />
<xs:element name="ignoreExceptions" type="ExceptionsType" minOccurs="0" maxOccurs="1" />
Expand All @@ -40,25 +32,7 @@
<xs:attribute name="serializer" type="xs:string" />

<xs:attribute name="addParamDefaultToDocblockType" type="xs:boolean" default="false" />

<xs:attribute name="allowCoercionFromStringToClassConst" type="xs:boolean" default="false">
<xs:annotation>
<!-- note: for PHPStorm to mark the attribute as deprecated the doc entry has to be *single line* and start with the word `deprecated` -->
<xs:documentation xml:lang="en">
Deprecated. Has no effect since Psalm 3 and is going to be removed in Psalm 5.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="allowFileIncludes" type="xs:boolean" default="true" />
<xs:attribute name="allowPhpStormGenerics" type="xs:boolean" default="false">
<xs:annotation>
<!-- note: for PHPStorm to mark the attribute as deprecated the doc entry has to be *single line* and start with the word `deprecated` -->
<xs:documentation xml:lang="en">
Deprecated. PHPStorm now supports generics for the most part and @psalm- annotations can be used
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="allowStringToStandInForClass" type="xs:boolean" default="false" />
<xs:attribute name="checkForThrowsDocblock" type="xs:boolean" default="false" />
<xs:attribute name="checkForThrowsInGlobalScope" type="xs:boolean" default="false" />
Expand All @@ -67,13 +41,6 @@
<xs:attribute name="findUnusedCode" type="xs:boolean" default="false" />
<xs:attribute name="findUnusedVariablesAndParams" type="xs:boolean" default="false" />
<xs:attribute name="findUnusedPsalmSuppress" type="xs:boolean" default="false" />
<xs:attribute name="forbidEcho" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation xml:lang="en">
Deprecated. Will be replaced by adding echo to forbiddenFunctions in Psalm 5.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="hideExternalErrors" type="xs:boolean" default="false" />
<xs:attribute name="hoistConstants" type="xs:boolean" default="false" />
<xs:attribute name="ignoreInternalFunctionFalseReturn" type="xs:boolean" default="true" />
Expand Down Expand Up @@ -156,6 +123,7 @@
<xs:complexType name="ProjectDirectoryAttributeType">
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="ignoreTypeStats" type="xs:string" />
<xs:attribute name="resolveSymlinks" type="xs:boolean" />
<xs:attribute name="useStrictTypes" type="xs:string" />
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
Expand Down Expand Up @@ -263,7 +231,6 @@
<xs:element name="FalsableReturnStatement" type="IssueHandlerType" minOccurs="0" />
<xs:element name="FalseOperand" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ForbiddenCode" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ForbiddenEcho" type="IssueHandlerType" minOccurs="0" />
<xs:element name="IfThisIsMismatch" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ImplementationRequirementViolation" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ImplementedParamTypeMismatch" type="IssueHandlerType" minOccurs="0" />
Expand Down Expand Up @@ -293,6 +260,7 @@
<xs:element name="InvalidCatch" type="ClassIssueHandlerType" minOccurs="0" />
<xs:element name="InvalidClass" type="ClassIssueHandlerType" minOccurs="0" />
<xs:element name="InvalidClone" type="IssueHandlerType" minOccurs="0" />
<xs:element name="InvalidConstantAssignmentValue" type="ClassConstantIssueHandlerType" minOccurs="0" />
<xs:element name="InvalidDocblock" type="IssueHandlerType" minOccurs="0" />
<xs:element name="InvalidDocblockParamName" type="IssueHandlerType" minOccurs="0" />
<xs:element name="InvalidEnumBackingType" type="ClassIssueHandlerType" minOccurs="0" />
Expand Down Expand Up @@ -496,6 +464,7 @@
<xs:element name="UnnecessaryVarAnnotation" type="IssueHandlerType" minOccurs="0" />
<xs:element name="UnrecognizedExpression" type="IssueHandlerType" minOccurs="0" />
<xs:element name="UnrecognizedStatement" type="IssueHandlerType" minOccurs="0" />
<xs:element name="UnresolvableConstant" type="IssueHandlerType" minOccurs="0" />
<xs:element name="UnresolvableInclude" type="IssueHandlerType" minOccurs="0" />
<xs:element name="UnsafeInstantiation" type="IssueHandlerType" minOccurs="0" />
<xs:element name="UnsafeGenericInstantiation" type="IssueHandlerType" minOccurs="0" />
Expand Down Expand Up @@ -640,6 +609,24 @@
<xs:attribute name="errorLevel" type="ErrorLevelType" />
</xs:complexType>

<xs:complexType name="ClassConstantIssueHandlerType">
<xs:sequence>
<xs:element name="errorLevel" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="directory" minOccurs="0" maxOccurs="unbounded" type="NameAttributeType" />
<xs:element name="file" minOccurs="0" maxOccurs="unbounded" type="NameAttributeType" />
<xs:element name="referencedConstant" minOccurs="0" maxOccurs="unbounded" type="NameAttributeType" />
</xs:choice>

<xs:attribute name="type" type="ErrorLevelType" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>

<xs:attribute name="errorLevel" type="ErrorLevelType" />
</xs:complexType>

<xs:complexType name="VariableIssueHandlerType">
<xs:sequence>
<xs:element name="errorLevel" minOccurs="0" maxOccurs="unbounded">
Expand Down