Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vimeo/psalm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5.4.0
Choose a base ref
...
head repository: vimeo/psalm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5.5.0
Choose a head ref

Commits on Nov 27, 2022

  1. Copy the full SHA
    de96494 View commit details

Commits on Nov 30, 2022

  1. Fixes #8112

    Emmanuel GUITON committed Nov 30, 2022
    Copy the full SHA
    0d9d0ed View commit details
  2. Style fix.

    Emmanuel GUITON committed Nov 30, 2022
    Copy the full SHA
    fcbd23c View commit details

Commits on Dec 19, 2022

  1. getopt return type fix

    jack-worman committed Dec 19, 2022
    Copy the full SHA
    b712355 View commit details

Commits on Dec 20, 2022

  1. Fix bug

    danog committed Dec 20, 2022
    Copy the full SHA
    02cd829 View commit details
  2. Update

    danog committed Dec 20, 2022
    Copy the full SHA
    3549162 View commit details
  3. Merge pull request #8955 from Nicelocal/fix

    Fix bug
    orklah authored Dec 20, 2022
    Copy the full SHA
    a89bbc3 View commit details
  4. Merge pull request #8945 from jack-worman/getopt_return_type_fix

    getopt() return type fix
    orklah authored Dec 20, 2022
    Copy the full SHA
    815919c View commit details
  5. Merge pull request #8781 from weirdan/8758-optional-offsets-in-phpsto…

    …rm-meta
    
    Allow omitting argument offsets for map-type overrides in phpstorm.meta
    orklah authored Dec 20, 2022
    Copy the full SHA
    91081f7 View commit details
  6. Copy the full SHA
    b2ccf24 View commit details

Commits on Dec 21, 2022

  1. Copy the full SHA
    96f8902 View commit details
  2. Update BCC

    weirdan committed Dec 21, 2022
    Copy the full SHA
    c50e370 View commit details
  3. Copy the full SHA
    59149e9 View commit details
  4. Copy the full SHA
    94adf78 View commit details
  5. Additional code style fixes (#8112).

    Emmanuel GUITON committed Dec 21, 2022
    Copy the full SHA
    3364bd9 View commit details
  6. Copy the full SHA
    903c00c View commit details
  7. Copy the full SHA
    f5e70bd View commit details
  8. Remove occurrences

    jack-worman committed Dec 21, 2022
    Copy the full SHA
    896799d View commit details
  9. Revert

    danog committed Dec 21, 2022
    Copy the full SHA
    dd721a2 View commit details
  10. Revert

    danog committed Dec 21, 2022
    Copy the full SHA
    e2a5ef1 View commit details
  11. Copy the full SHA
    da24142 View commit details
  12. Copy the full SHA
    c69ebc6 View commit details
  13. Copy the full SHA
    63e0e4a View commit details
  14. Merge pull request #8974 from fluffycondor/chr-non-empty-string

    (mb_)chr returns a non-empty-string
    orklah authored Dec 21, 2022
    Copy the full SHA
    9c0c234 View commit details
  15. Merge pull request #8967 from jack-worman/Remove_occurrences

    Remove occurrences from error baseline
    orklah authored Dec 21, 2022
    Copy the full SHA
    898aa90 View commit details
  16. Copy the full SHA
    ed85945 View commit details
  17. Merge pull request #8976 from michnovka/master

    Add DateTimeInterface::__serialize and __unserialize
    orklah authored Dec 21, 2022
    Copy the full SHA
    c75f06e View commit details

Commits on Dec 22, 2022

  1. Copy the full SHA
    8e5904d View commit details
  2. Merge pull request #8973 from jack-worman/Fix_get_object_vars_on_enums

    Fix get_object_vars on enums
    orklah authored Dec 22, 2022
    Copy the full SHA
    390da64 View commit details
  3. Copy the full SHA
    b138107 View commit details
  4. Copy the full SHA
    164e279 View commit details
  5. Copy the full SHA
    7924a52 View commit details
  6. Copy the full SHA
    e48ccab View commit details
  7. Copy the full SHA
    1cde7e4 View commit details

Commits on Dec 23, 2022

  1. Copy the full SHA
    d6eca8c View commit details
  2. Merge pull request #8990 from othercorey/verify-param-nullable

    Verify nullable callmap parameters
    orklah authored Dec 23, 2022
    Copy the full SHA
    5979579 View commit details
  3. Copy the full SHA
    bf6ef64 View commit details
  4. Copy the full SHA
    08b73f2 View commit details
  5. Fix missing version in PHARs build on GA

    We were overriding the root version with COMPOSER_ROOT_VERSION, so all
    PHARs had `dev-master` as the version for `vimeo/psalm` baked in.
    
    Fixed #7606
    weirdan committed Dec 23, 2022
    Copy the full SHA
    7dd25b4 View commit details
  6. Merge pull request #8997 from weirdan/fix-missing-composer-version

    Fix missing version in PHARs build on GA
    orklah authored Dec 23, 2022
    Copy the full SHA
    8b05f2e View commit details
  7. @psalm-api

    jack-worman committed Dec 23, 2022
    Copy the full SHA
    703a1e1 View commit details

Commits on Dec 24, 2022

  1. Failing test

    VincentLanglet committed Dec 24, 2022
    Copy the full SHA
    723001d View commit details
  2. Fix

    VincentLanglet committed Dec 24, 2022
    Copy the full SHA
    06010b4 View commit details
  3. Update type

    VincentLanglet committed Dec 24, 2022
    Copy the full SHA
    ebd5727 View commit details
  4. Copy the full SHA
    f9e9aad View commit details
  5. Copy the full SHA
    69da58d View commit details
  6. Copy the full SHA
    1bb9eb4 View commit details
  7. Copy the full SHA
    58ae748 View commit details

Commits on Dec 25, 2022

  1. Copy the full SHA
    a077bd4 View commit details
  2. Fix test

    fluffycondor committed Dec 25, 2022
    Copy the full SHA
    032f011 View commit details
Showing with 5,175 additions and 2,569 deletions.
  1. +5 −2 .github/workflows/build-phar.yml
  2. +1 −1 .github/workflows/ci.yml
  3. +1 −1 .github/workflows/pr-labels.yml
  4. +1 −1 .github/workflows/windows-ci.yml
  5. +12 −6 composer.json
  6. +8 −0 config.xsd
  7. +488 −491 dictionaries/CallMap.php
  8. +3 −7 dictionaries/CallMap_71_delta.php
  9. +30 −5 dictionaries/CallMap_72_delta.php
  10. +12 −0 dictionaries/CallMap_74_delta.php
  11. +775 −118 dictionaries/CallMap_80_delta.php
  12. +97 −65 dictionaries/CallMap_81_delta.php
  13. +3 −0 dictionaries/CallMap_82_delta.php
  14. +323 −329 dictionaries/CallMap_historical.php
  15. +16 −1 docs/annotating_code/supported_annotations.md
  16. +5 −2 docs/annotating_code/type_syntax/array_types.md
  17. +3 −1 docs/annotating_code/type_syntax/atomic_types.md
  18. +31 −0 docs/annotating_code/type_syntax/callable_types.md
  19. +4 −0 docs/annotating_code/type_syntax/intersection_types.md
  20. +2 −2 docs/annotating_code/type_syntax/scalar_types.md
  21. +1 −0 docs/annotating_code/type_syntax/top_bottom_types.md
  22. +9 −7 docs/annotating_code/type_syntax/utility_types.md
  23. +61 −0 docs/running_psalm/configuration.md
  24. +2 −0 docs/running_psalm/issues.md
  25. +15 −0 docs/running_psalm/issues/ConstantDeclarationInTrait.md
  26. +1 −1 docs/running_psalm/issues/ForbiddenCode.md
  27. +5 −1 docs/running_psalm/issues/PossiblyUnusedMethod.md
  28. +5 −1 docs/running_psalm/issues/PossiblyUnusedProperty.md
  29. +22 −0 docs/running_psalm/issues/UnusedBaselineEntry.md
  30. +4 −1 docs/running_psalm/issues/UnusedClass.md
  31. +5 −1 docs/running_psalm/issues/UnusedMethod.md
  32. +5 −1 docs/running_psalm/issues/UnusedProperty.md
  33. +1 −1 phpcs.xml
  34. +4 −0 phpunit.xml.dist
  35. +134 −126 psalm-baseline.xml
  36. +1 −5 psalm.xml.dist
  37. +109 −13 src/Psalm/Config.php
  38. +1 −0 src/Psalm/Config/Creator.php
  39. +1 −0 src/Psalm/DocComment.php
  40. +17 −24 src/Psalm/ErrorBaseline.php
  41. +50 −6 src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php
  42. +2 −0 src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeCollector.php
  43. +1 −0 src/Psalm/Internal/Analyzer/InterfaceAnalyzer.php
  44. +23 −5 src/Psalm/Internal/Analyzer/ProjectAnalyzer.php
  45. +0 −6 src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php
  46. +1 −1 src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  47. +22 −6 src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php
  48. +26 −3 src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php
  49. +6 −1 src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php
  50. +9 −0 src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php
  51. +0 −8 src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php
  52. +2 −0 src/Psalm/Internal/Analyzer/StatementsAnalyzer.php
  53. +67 −27 src/Psalm/Internal/Cli/Psalm.php
  54. +0 −5 src/Psalm/Internal/CliUtils.php
  55. +89 −34 src/Psalm/Internal/Codebase/ClassLikes.php
  56. +11 −5 src/Psalm/Internal/Codebase/Methods.php
  57. +58 −0 src/Psalm/Internal/Codebase/Populator.php
  58. +2 −0 src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php
  59. +53 −16 src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php
  60. +5 −1 src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php
  61. +0 −2 src/Psalm/Internal/Provider/FunctionReturnTypeProvider.php
  62. +1 −1 src/Psalm/Internal/Provider/MethodReturnTypeProvider.php
  63. +6 −1 src/Psalm/Internal/Provider/ReturnTypeProvider/DateTimeModifyReturnTypeProvider.php
  64. +0 −103 src/Psalm/Internal/Provider/ReturnTypeProvider/ExplodeReturnTypeProvider.php
  65. +27 −7 src/Psalm/Internal/Provider/ReturnTypeProvider/GetObjectVarsReturnTypeProvider.php
  66. +2 −0 src/Psalm/Internal/Scanner/ClassLikeDocblockComment.php
  67. +20 −6 src/Psalm/Internal/Scanner/PhpStormMetaScanner.php
  68. +4 −4 src/Psalm/Internal/Type/AssertionReconciler.php
  69. +6 −4 src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php
  70. +47 −0 src/Psalm/Internal/Type/Comparator/ObjectComparator.php
  71. +10 −10 src/Psalm/Internal/Type/NegatedAssertionReconciler.php
  72. +166 −147 src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  73. +128 −122 src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php
  74. +28 −14 src/Psalm/Internal/Type/TypeCombiner.php
  75. +3 −0 src/Psalm/Internal/Type/TypeTokenizer.php
  76. +11 −0 src/Psalm/Issue/ConstantDeclarationInTrait.php
  77. +11 −0 src/Psalm/Issue/UnusedBaselineEntry.php
  78. +39 −5 src/Psalm/IssueBuffer.php
  79. +9 −2 src/Psalm/Plugin/EventHandler/Event/BeforeAddIssueEvent.php
  80. +3 −5 src/Psalm/Plugin/EventHandler/Event/MethodReturnTypeProviderEvent.php
  81. +10 −1 src/Psalm/Plugin/EventHandler/Event/StringInterpreterEvent.php
  82. +114 −98 src/Psalm/Plugin/Shepherd.php
  83. +6 −0 src/Psalm/Progress/Progress.php
  84. +1 −1 src/Psalm/Storage/Assertion/IsAClass.php
  85. +5 −0 src/Psalm/Storage/Assertion/IsNotAClass.php
  86. +9 −1 src/Psalm/Storage/ClassLikeStorage.php
  87. +3 −2 src/Psalm/Type.php
  88. +10 −1 src/Psalm/Type/Atomic.php
  89. +17 −0 src/Psalm/Type/Atomic/TNamedObject.php
  90. +1 −2 src/Psalm/Type/MutableUnion.php
  91. +1 −2 src/Psalm/Type/Union.php
  92. +30 −0 stubs/CoreGenericClasses.phpstub
  93. +105 −1 stubs/CoreGenericFunctions.phpstub
  94. +25 −0 stubs/Php80.phpstub
  95. +8 −0 stubs/Php81.phpstub
  96. +15 −19 stubs/Reflection.phpstub
  97. +3 −4 stubs/extensions/dom.phpstub
  98. +228 −226 stubs/extensions/redis.phpstub
  99. +13 −0 tests/ArrayFunctionCallTest.php
  100. +1 −1 tests/AssertAnnotationTest.php
  101. +20 −0 tests/ClosureTest.php
  102. +1 −0 tests/Config/CreatorTest.php
  103. +16 −2 tests/DateTimeTest.php
  104. +80 −66 tests/DocCommentTest.php
  105. +2 −0 tests/DocumentationTest.php
  106. +13 −0 tests/EndToEnd/PsalmEndToEndTest.php
  107. +75 −1 tests/EnumTest.php
  108. +16 −13 tests/ErrorBaselineTest.php
  109. +51 −0 tests/ExtLibxmlStubTest.php
  110. +1 −1 tests/FileManipulation/ReturnTypeManipulationTest.php
  111. +34 −0 tests/ForbiddenCodeTest.php
  112. +70 −21 tests/FunctionCallTest.php
  113. +144 −1 tests/IntRangeTest.php
  114. +3 −3 tests/Internal/CallMapTest.php
  115. +25 −299 tests/Internal/Codebase/InternalCallMapHandlerTest.php
  116. +3 −1 tests/MagicMethodAnnotationTest.php
  117. +1 −1 tests/MethodCallTest.php
  118. +13 −0 tests/MethodSignatureTest.php
  119. +12 −11 tests/ProjectCheckerTest.php
  120. +132 −0 tests/ReturnTypeProvider/GetObjectVarsTest.php
  121. +77 −1 tests/StubTest.php
  122. +19 −1 tests/SuperGlobalsTest.php
  123. +88 −0 tests/TaintTest.php
  124. +69 −5 tests/Template/ClassTemplateExtendsTest.php
  125. +22 −0 tests/Template/ClassTemplateTest.php
  126. +221 −0 tests/Template/NestedTemplateTest.php
  127. +44 −0 tests/TraitTest.php
  128. +9 −1 tests/Traits/InvalidCodeAnalysisTestTrait.php
  129. +3 −1 tests/TypeReconciliation/ConditionalTest.php
  130. +0 −9 tests/TypeReconciliation/IssetTest.php
  131. +4 −0 tests/TypeReconciliation/ReconcilerTest.php
  132. +23 −0 tests/TypeReconciliation/RedundantConditionTest.php
  133. +7 −0 tests/TypeReconciliation/ScopeTest.php
  134. +87 −0 tests/UnusedCodeTest.php
  135. +13 −0 tests/fixtures/stubs/phpstorm.meta.php
  136. +1 −1 vendor-bin/bcc/composer.json
7 changes: 5 additions & 2 deletions .github/workflows/build-phar.yml
Original file line number Diff line number Diff line change
@@ -43,6 +43,8 @@ jobs:
coverage: none

- uses: actions/checkout@v3
with:
fetch-depth: 0 # required for composer to automatically detect root package version

- name: Get Composer Cache Directories
id: composer-cache
@@ -62,8 +64,9 @@ jobs:
- name: Run composer install
run: composer install -o
env:
COMPOSER_ROOT_VERSION: dev-master
# DO NOT set this, we need composer to figure out the version itself
# env:
# COMPOSER_ROOT_VERSION: dev-master

- run: bin/build-phar.sh
env:
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ jobs:
ini-values: zend.assertions=1, assert.exception=1
tools: composer:v2
coverage: none
extensions: none, curl, dom, filter, json, libxml, mbstring, openssl, 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

- uses: actions/checkout@v3

2 changes: 1 addition & 1 deletion .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v2
- uses: mheap/github-action-required-labels@v3
with:
mode: minimum
count: 1
2 changes: 1 addition & 1 deletion .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ jobs:
ini-values: zend.assertions=1, assert.exception=1
tools: composer:v2
coverage: none
extensions: none, curl, dom, filter, json, libxml, mbstring, openssl, 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

- uses: actions/checkout@v3

18 changes: 12 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -33,11 +33,10 @@
"fidry/cpu-core-counter": "^0.4.0",
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
"nikic/php-parser": "^4.13",
"sebastian/diff": "^4.0",
"sebastian/diff": "^4.0 || ^5.0",
"spatie/array-to-xml": "^2.17.0",
"symfony/console": "^4.1.6 || ^5.0 || ^6.0",
"symfony/filesystem": "^5.4 || ^6.0",
"symfony/polyfill-php80": "^1.25"
"symfony/filesystem": "^5.4 || ^6.0"
},
"provide": {
"psalm/psalm": "self.version"
@@ -109,10 +108,17 @@
"cs": "phpcs -ps",
"cs-fix": "phpcbf -ps",
"lint": "parallel-lint ./src ./tests",
"phpunit": "paratest --runner=WrapperRunner",
"phpunit-std": "phpunit",
"phpunit": [
"Composer\\Config::disableProcessTimeout",
"paratest --runner=WrapperRunner"
],
"phpunit-std": [
"Composer\\Config::disableProcessTimeout",
"phpunit"
],
"verify-callmap": "phpunit tests/Internal/Codebase/InternalCallMapHandlerTest.php",
"psalm": "@php ./psalm --find-dead-code",
"psalm": "@php ./psalm",
"psalm-set-baseline": "@php ./psalm --set-baseline=psalm-baseline.xml",
"tests": [
"@lint",
"@cs",
8 changes: 8 additions & 0 deletions config.xsd
Original file line number Diff line number Diff line change
@@ -44,6 +44,8 @@
<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" />
<!-- TODO: Update default to true in Psalm 6 -->
<xs:attribute name="findUnusedBaselineEntry" type="xs:boolean" default="false" />
<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" />
@@ -206,6 +208,7 @@
<xs:element name="ComplexMethod" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ConfigIssue" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ConflictingReferenceConstraint" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ConstantDeclarationInTrait" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ConstructorSignatureMismatch" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ContinueOutsideLoop" type="IssueHandlerType" minOccurs="0" />
<xs:element name="DeprecatedClass" type="ClassIssueHandlerType" minOccurs="0" />
@@ -475,6 +478,7 @@
<xs:element name="UnsafeGenericInstantiation" type="IssueHandlerType" minOccurs="0" />
<xs:element name="UnsafeInstantiation" type="IssueHandlerType" minOccurs="0" />
<xs:element name="UnsupportedReferenceUsage" type="IssueHandlerType" minOccurs="0" />
<xs:element name="UnusedBaselineEntry" type="IssueHandlerType" minOccurs="0" />
<xs:element name="UnusedClass" type="ClassIssueHandlerType" minOccurs="0" />
<xs:element name="UnusedClosureParam" type="IssueHandlerType" minOccurs="0" />
<xs:element name="UnusedConstructor" type="MethodIssueHandlerType" minOccurs="0" />
@@ -711,14 +715,18 @@

<xs:simpleType name="ExtensionType">
<xs:restriction base="xs:string">
<xs:enumeration value="apcu"/>
<xs:enumeration value="decimal"/>
<xs:enumeration value="dom"/>
<xs:enumeration value="ds"/>
<xs:enumeration value="ffi"/>
<xs:enumeration value="geos"/>
<xs:enumeration value="gmp"/>
<xs:enumeration value="mongodb"/>
<xs:enumeration value="mysqli"/>
<xs:enumeration value="pdo"/>
<xs:enumeration value="random"/>
<xs:enumeration value="redis"/>
<xs:enumeration value="simplexml"/>
<xs:enumeration value="soap"/>
<xs:enumeration value="xdebug"/>
Loading