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.13.1
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.14.0
Choose a head ref

Commits on Jun 27, 2023

  1. Copy the full SHA
    0584339 View commit details
  2. Copy the full SHA
    b877aa7 View commit details

Commits on Jun 28, 2023

  1. Use getParts() instead of $parts on PhpParser\Node\Name.

    also use getFirst(), getLast() and getString()
    ygottschalk committed Jun 28, 2023
    Copy the full SHA
    5a2f7c0 View commit details
  2. Copy the full SHA
    7aac142 View commit details

Commits on Jun 29, 2023

  1. Copy the full SHA
    2dd26cb View commit details
  2. code style

    kkmuffme committed Jun 29, 2023
    Copy the full SHA
    62475cb View commit details

Commits on Jun 30, 2023

  1. fix mixed replace return types for arrays

    * remove useless replace return type provider code that returned incorrect type for array replacements and was worse duplicate of existing stubs
    * require preg patterns to be non-empty-strings as otherwise it will throw a PHP notice
    * improve return type of array replacements to be more correct (not fully correct due to #5994 (comment))
    kkmuffme committed Jun 30, 2023
    Copy the full SHA
    26eb870 View commit details
  2. code style

    kkmuffme committed Jun 30, 2023
    Copy the full SHA
    09a3b4b View commit details
  3. Infer output format from GITHUB_ACTIONS env

    aka --output-format=github
    ro0NL authored Jun 30, 2023
    Copy the full SHA
    8ed4f94 View commit details

Commits on Jul 1, 2023

  1. Update PsalmRunnerTrait.php

    ro0NL authored Jul 1, 2023
    Copy the full SHA
    7cf87b2 View commit details
  2. Update PsalmRunnerTrait.php

    ro0NL authored Jul 1, 2023
    Copy the full SHA
    f0e2856 View commit details
  3. Update PsalmRunnerTrait.php

    ro0NL authored Jul 1, 2023
    Copy the full SHA
    0617274 View commit details
  4. infer --debug in GHA

    ro0NL authored Jul 1, 2023
    Copy the full SHA
    52c629c View commit details
  5. Update Psalm.php

    ro0NL authored Jul 1, 2023
    Copy the full SHA
    ce9d9db View commit details
  6. Update Psalm.php

    ro0NL authored Jul 1, 2023
    Copy the full SHA
    010306f View commit details
  7. ugh

    ro0NL authored Jul 1, 2023
    Copy the full SHA
    33b0693 View commit details
  8. Update PsalmRunnerTrait.php

    ro0NL authored Jul 1, 2023
    Copy the full SHA
    039c526 View commit details
  9. Update Psalm.php

    ro0NL authored Jul 1, 2023
    Copy the full SHA
    f07cdfc View commit details
  10. Update Psalm.php

    ro0NL authored Jul 1, 2023
    Copy the full SHA
    bf31ffb View commit details
  11. Copy the full SHA
    b525f9c View commit details

Commits on Jul 2, 2023

  1. Copy the full SHA
    c2388b4 View commit details
  2. Copy the full SHA
    7593b5b View commit details
  3. Copy the full SHA
    d24df1a View commit details
  4. code style

    kkmuffme committed Jul 2, 2023
    Copy the full SHA
    0377dd9 View commit details
  5. Merge pull request #9982 from ro0NL/patch-1

    Infer output format from GITHUB_ACTIONS env
    orklah authored Jul 2, 2023
    Copy the full SHA
    3c3d184 View commit details
  6. Merge pull request #9975 from kkmuffme/sprintf-single-arg-splat-array

    Fix sprintf single arg splat array
    orklah authored Jul 2, 2023
    Copy the full SHA
    53ce62b View commit details
  7. Merge pull request #9981 from kkmuffme/fix-replace-functions-return-t…

    …ype-provider-less-specific
    
    fix mixed replace return types for arrays
    orklah authored Jul 2, 2023
    Copy the full SHA
    8d1876a View commit details

Commits on Jul 3, 2023

  1. Copy the full SHA
    1787960 View commit details
  2. Fixed psalm self test

    ygottschalk committed Jul 3, 2023
    Copy the full SHA
    42b3736 View commit details
  3. Added issue suppression

    ygottschalk committed Jul 3, 2023
    Copy the full SHA
    e819a60 View commit details
  4. Copy the full SHA
    539aa4c View commit details
  5. Added issue suppression

    because constructor analysis of stubbed classes seems unsupported
    ygottschalk committed Jul 3, 2023
    Copy the full SHA
    bfd3cb8 View commit details
  6. Merge pull request #9990 from ygottschalk/fix/9989-psalm-self-test

    Fixed psalm self test
    orklah authored Jul 3, 2023
    Copy the full SHA
    bc46938 View commit details
  7. Merge pull request #9964 from ygottschalk/fix/phpparser-deprecation-n…

    …ame-parts
    
    Fix/phpparser deprecation name parts
    orklah authored Jul 3, 2023
    Copy the full SHA
    3e54feb View commit details
  8. Copy the full SHA
    9575bc3 View commit details
  9. Merge branch 'master' into missing-composer-lock-should-not-invalidat…

    …e-cache-created-with-missing-composer-lock
    orklah authored Jul 3, 2023
    Copy the full SHA
    a83c3fe View commit details
  10. Merge pull request #9988 from ygottschalk/fix/9968-exhume-enum

    Fixed exhuming enums as enums, not as classes
    orklah authored Jul 3, 2023
    Copy the full SHA
    1f92b8d View commit details
  11. Merge pull request #9970 from kkmuffme/missing-composer-lock-should-n…

    …ot-invalidate-cache-created-with-missing-composer-lock
    
    Missing composer lock should not invalidate cache created with missing composer lock
    orklah authored Jul 3, 2023
    Copy the full SHA
    27798e6 View commit details
  12. Copy the full SHA
    b412632 View commit details
  13. Merge pull request #9992 from kkmuffme/make-stubbed-constant-types-co…

    …nfigurable-with-comment
    
    make stubbed constant types configurable with comment
    orklah authored Jul 3, 2023
    Copy the full SHA
    768b813 View commit details
  14. no error for printf with only 1 arg

    Fix #9987
    kkmuffme committed Jul 3, 2023
    Copy the full SHA
    8d8adef View commit details
  15. Merge pull request #9993 from kkmuffme/allow-printf-with-1-arg

    no error for printf with only 1 arg
    orklah authored Jul 3, 2023
    Copy the full SHA
    8fe1f15 View commit details

Commits on Jul 5, 2023

  1. offsetExists/Get/Set/Unset types were too generic since only array ke…

    …y types + null lead to expected results
    kkmuffme committed Jul 5, 2023
    Copy the full SHA
    ce7b78c View commit details
  2. update historical

    kkmuffme committed Jul 5, 2023
    Copy the full SHA
    3d8629f View commit details
  3. more historical

    kkmuffme committed Jul 5, 2023
    Copy the full SHA
    05f4e45 View commit details
  4. Allow space before array shape opening brace and added unit tests for…

    … `\Psalm\Internal\Analyzer\CommentAnalyzer::splitDocLine()`
    rhertogh committed Jul 5, 2023
    Copy the full SHA
    242a38c View commit details

Commits on Jul 6, 2023

  1. fix "days" ignore falsable return not ignored correctly

    see Reflection.php, where the same condition was used already, but was insufficient
    kkmuffme committed Jul 6, 2023
    Copy the full SHA
    9fd5906 View commit details
  2. Copy the full SHA
    fc85ecb View commit details
  3. Merge pull request #9998 from kkmuffme/days-property-remove-false-type

    Fix "days" falsable return not ignored consistently
    orklah authored Jul 6, 2023
    Copy the full SHA
    ae19418 View commit details
  4. Merge pull request #9999 from kkmuffme/improve-generic-offset-method-…

    …types
    
    offsetExists/Get/Set/Unset types were too generic
    orklah authored Jul 6, 2023
    Copy the full SHA
    b12e4f2 View commit details
Showing with 2,573 additions and 826 deletions.
  1. +1 −0 .circleci/config.yml
  2. +52 −2 .github/workflows/ci.yml
  3. +3 −3 composer.json
  4. +71 −95 dictionaries/CallMap.php
  5. +116 −0 dictionaries/CallMap_83_delta.php
  6. +48 −48 dictionaries/CallMap_historical.php
  7. +13 −0 docs/annotating_code/type_syntax/array_types.md
  8. +18 −7 docs/running_psalm/language_server.md
  9. +1 −1 examples/plugins/FunctionCasingChecker.php
  10. +1 −1 examples/plugins/StringChecker.php
  11. +1 −0 psalm.xml.dist
  12. +7 −4 src/Psalm/Codebase.php
  13. +5 −0 src/Psalm/Config/Creator.php
  14. +32 −7 src/Psalm/Config/FileFilter.php
  15. +3 −4 src/Psalm/Internal/Analyzer/CanAlias.php
  16. +2 −2 src/Psalm/Internal/Analyzer/ClassAnalyzer.php
  17. +4 −5 src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php
  18. +23 −0 src/Psalm/Internal/Analyzer/CommentAnalyzer.php
  19. +1 −2 src/Psalm/Internal/Analyzer/FileAnalyzer.php
  20. +1 −2 src/Psalm/Internal/Analyzer/NamespaceAnalyzer.php
  21. +4 −4 src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php
  22. +1 −1 src/Psalm/Internal/Analyzer/Statements/Block/SwitchCaseAnalyzer.php
  23. +2 −1 src/Psalm/Internal/Analyzer/Statements/Block/WhileAnalyzer.php
  24. +48 −48 src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  25. +1 −1 src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php
  26. +6 −1 src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php
  27. +9 −6 src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php
  28. +5 −6 src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php
  29. +6 −6 src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php
  30. +7 −7 src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php
  31. +5 −5 ...lm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php
  32. +1 −1 src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php
  33. +4 −4 src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php
  34. +6 −6 src/Psalm/Internal/Analyzer/Statements/Expression/ExpressionIdentifier.php
  35. +1 −1 src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ConstFetchAnalyzer.php
  36. +4 −4 src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/StaticPropertyFetchAnalyzer.php
  37. +2 −2 src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php
  38. +2 −2 src/Psalm/Internal/Analyzer/Statements/Expression/InstanceofAnalyzer.php
  39. +5 −5 src/Psalm/Internal/Analyzer/Statements/Expression/MatchAnalyzer.php
  40. +6 −6 src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php
  41. +1 −1 src/Psalm/Internal/Analyzer/StatementsAnalyzer.php
  42. +2 −1 src/Psalm/Internal/Cache.php
  43. +66 −1 src/Psalm/Internal/Cli/LanguageServer.php
  44. +13 −0 src/Psalm/Internal/Cli/Psalm.php
  45. +25 −9 src/Psalm/Internal/Codebase/ClassLikes.php
  46. +2 −2 src/Psalm/Internal/Diff/FileStatementsDiffer.php
  47. +2 −2 src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php
  48. +83 −0 src/Psalm/Internal/LanguageServer/Client/Progress/LegacyProgress.php
  49. +121 −0 src/Psalm/Internal/LanguageServer/Client/Progress/Progress.php
  50. +16 −0 src/Psalm/Internal/LanguageServer/Client/Progress/ProgressInterface.php
  51. +13 −1 src/Psalm/Internal/LanguageServer/LanguageClient.php
  52. +71 −45 src/Psalm/Internal/LanguageServer/LanguageServer.php
  53. +61 −0 src/Psalm/Internal/LanguageServer/PathMapper.php
  54. +16 −22 src/Psalm/Internal/LanguageServer/Server/TextDocument.php
  55. +5 −6 src/Psalm/Internal/LanguageServer/Server/Workspace.php
  56. +7 −2 src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php
  57. +19 −20 src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php
  58. +26 −3 src/Psalm/Internal/PhpVisitor/Reflector/ExpressionScanner.php
  59. +3 −4 src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php
  60. +2 −3 src/Psalm/Internal/PhpVisitor/Reflector/TypeHintResolver.php
  61. +6 −7 src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php
  62. +4 −4 src/Psalm/Internal/Provider/AddRemoveTaints/HtmlFunctionTainter.php
  63. +1 −2 src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php
  64. +2 −4 src/Psalm/Internal/Provider/ParserCacheProvider.php
  65. +11 −12 src/Psalm/Internal/Provider/ProjectCacheProvider.php
  66. +249 −69 src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php
  67. +22 −15 src/Psalm/Internal/Provider/ReturnTypeProvider/SprintfReturnTypeProvider.php
  68. +21 −40 src/Psalm/Internal/Provider/ReturnTypeProvider/StrReplaceReturnTypeProvider.php
  69. +7 −8 src/Psalm/Internal/Scanner/PhpStormMetaScanner.php
  70. +31 −0 src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php
  71. +4 −6 src/Psalm/Internal/Type/TypeCombiner.php
  72. +56 −57 src/Psalm/IssueBuffer.php
  73. +38 −24 stubs/CoreGenericFunctions.phpstub
  74. +231 −39 stubs/extensions/mongodb.phpstub
  75. +10 −0 stubs/extensions/pdo.phpstub
  76. +18 −0 stubs/phpparser.phpstub
  77. +102 −20 tests/AnnotationTest.php
  78. +88 −0 tests/CallableTest.php
  79. +127 −0 tests/CommentAnalyzerTest.php
  80. +70 −40 tests/DateTimeTest.php
  81. +7 −0 tests/EndToEnd/PsalmRunnerTrait.php
  82. +13 −2 tests/FunctionCallTest.php
  83. +45 −45 tests/Internal/Codebase/InternalCallMapHandlerTest.php
  84. +16 −2 tests/LanguageServer/DiagnosticTest.php
  85. +75 −0 tests/LanguageServer/PathMapperTest.php
  86. +158 −2 tests/MethodCallTest.php
  87. +12 −6 tests/ReturnTypeProvider/SprintfTest.php
  88. +42 −0 tests/StubTest.php
  89. +15 −0 tests/Traits/ValidCodeAnalysisTestTrait.php
  90. +7 −0 tests/TypeCombinationTest.php
  91. +3 −0 tests/fixtures/stubs/constant_var_comment.phpstub
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/
# See https://app.circleci.com/pipelines/github/vimeo/psalm
version: 2.1
executors:
php-74:
54 changes: 52 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -49,6 +49,51 @@ jobs:

- run: |
git ls-files | grep \\\.php$ | grep -v ^dictionaries/scripts/* | ./vendor/bin/parallel-lint --stdin
code-style:
name: Code Style Analysis
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2
coverage: none
env:
fail-fast: true

- uses: actions/checkout@v3

- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT
- name: Generate composer.lock
run: composer update --no-install
env:
COMPOSER_ROOT_VERSION: dev-master

- name: Cache composer cache
uses: actions/cache@v3
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
${{ steps.composer-cache.outputs.vcs_cache }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Run composer install
run: composer install -o
env:
COMPOSER_ROOT_VERSION: dev-master

- name: Code Style Analysis with PHPCS
run: vendor/bin/phpcs -d memory_limit=512M

chunk-matrix:
permissions:
contents: none
@@ -70,7 +115,7 @@ jobs:
echo "chunks=$(php -r 'echo json_encode(range(1, ${{ env.CHUNK_COUNT }} ));')" >> $GITHUB_OUTPUT
tests:
name: "Unit Tests - ${{ matrix.chunk }}"
name: "Unit Tests - PHP ${{ matrix.php-version }} ${{ matrix.chunk }}/${{ matrix.count }}"

runs-on: ubuntu-latest
needs:
@@ -79,6 +124,11 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
count: ${{ fromJson(needs.chunk-matrix.outputs.count) }}
chunk: ${{ fromJson(needs.chunk-matrix.outputs.chunks) }}

@@ -91,7 +141,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: "${{ matrix.php-version }}"
ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
tools: composer:v2
coverage: none
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -15,25 +15,25 @@
}
],
"require": {
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0",
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"ext-SimpleXML": "*",
"ext-ctype": "*",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-tokenizer": "*",
"composer-runtime-api": "^2",
"amphp/amp": "^2.4.2",
"amphp/byte-stream": "^1.5",
"composer-runtime-api": "^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",
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
"nikic/php-parser": "^4.14",
"nikic/php-parser": "^4.16",
"sebastian/diff": "^4.0 || ^5.0",
"spatie/array-to-xml": "^2.17.0 || ^3.0",
"symfony/console": "^4.1.6 || ^5.0 || ^6.0",
Loading