Skip to content

Commit

Permalink
Merge branch 'origin_master'
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Nov 27, 2023
2 parents edf9bbb + 8058028 commit 3238f4e
Show file tree
Hide file tree
Showing 69 changed files with 3,892 additions and 697 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ jobs:
command: bin/build-phar.sh
- run:
name: Smoke test Phar file
command: build/psalm.phar --version
# Change the root away from the project root to avoid conflicts with the Composer autoloader
command: build/psalm.phar --version --root build
- store_artifacts:
path: build/psalm.phar
- run:
Expand All @@ -63,7 +64,7 @@ jobs:
# The resource_class feature allows configuring CPU and RAM resources for each job. Different resource classes are available for different executors. https://circleci.com/docs/2.0/configuration-reference/#resourceclass
resource_class: large
test-with-real-projects:
executor: php-81
executor: php-82
steps:
- checkout # used here just for the side effect of loading the github public ssh key so we can clone other stuff
- attach_workspace:
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 @@ -20,7 +20,7 @@ jobs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected].0
uses: fkirc/[email protected].1
with:
concurrent_skipping: always
cancel_others: true
Expand Down
7 changes: 5 additions & 2 deletions bin/test-with-real-projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ psl)
cd endtoend-test-psl
git checkout 2.3.x
composer install
"$PSALM" --monochrome -c config/psalm.xml
"$PSALM" --monochrome -c config/psalm.xml tests/static-analysis
# 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_PHAR" --monochrome -c config/psalm.xml
"$PSALM_PHAR" --monochrome -c config/psalm.xml tests/static-analysis
;;

laravel)
Expand Down
18 changes: 17 additions & 1 deletion bin/tests-github-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,23 @@ exit "$exit_code"'
mkdir -p build/parallel/ build/phpunit/logs/

find tests -name '*Test.php' | shuf --random-source=<(get_seeded_random) > build/tests_all
split --number="l/$chunk_number/$chunk_count" build/tests_all > build/tests_split
# split incorrectly splits the lines by byte size, which means that the number of tests per file are as evenly distributed as possible
#split --number="l/$chunk_number/$chunk_count" build/tests_all > build/tests_split
local -r lines=$(wc -l <build/tests_all)
local -r chunk_lines=$(( $lines / $chunk_count ))
local -r rest=$(( $lines % $chunk_count ))
local start_line
local end_line
if [[ $chunk_number -le $rest ]]
then
start_line=$(( ($chunk_number - 1) * $chunk_lines + $chunk_number ))
end_line=$(( $chunk_number * $chunk_lines + $chunk_number ))
else
start_line=$(( ($chunk_number - 1) * $chunk_lines + $rest + 1 ))
end_line=$(( $chunk_number * $chunk_lines + $rest ))
fi
awk "NR==$start_line,NR==$end_line" <build/tests_all > build/tests_split

parallel --group -j"$parallel_processes" --rpl {_}\ s/\\//_/g --joblog build/parallel/jobs.log "$phpunit_cmd" < build/tests_split
}

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"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",
"symfony/filesystem": "^5.4 || ^6.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"
Expand All @@ -60,7 +60,7 @@
"psalm/plugin-phpunit": "^0.18",
"slevomat/coding-standard": "^8.4",
"squizlabs/php_codesniffer": "^3.6",
"symfony/process": "^4.4 || ^5.0 || ^6.0"
"symfony/process": "^4.4 || ^5.0 || ^6.0 || ^7.0"
},
"suggest": {
"ext-igbinary": "^2.0.5 is required, used to serialize caching data",
Expand Down
158 changes: 41 additions & 117 deletions dictionaries/CallMap.php

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dictionaries/CallMap_74_delta.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
return [
'added' => [
'ReflectionProperty::getType' => ['?ReflectionType'],
'ReflectionProperty::isInitialized' => ['bool', 'object'=>'object'],
'mb_str_split' => ['list<string>|false', 'string'=>'string', 'length='=>'positive-int', 'encoding='=>'string'],
'openssl_x509_verify' => ['int', 'certificate'=>'string|resource', 'public_key'=>'string|array|resource'],
],
Expand Down
11 changes: 9 additions & 2 deletions dictionaries/CallMap_80_delta.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
'ReflectionFunctionAbstract::getAttributes' => ['list<ReflectionAttribute>', 'name='=>'?string', 'flags='=>'int'],
'ReflectionParameter::getAttributes' => ['list<ReflectionAttribute>', 'name='=>'?string', 'flags='=>'int'],
'ReflectionProperty::getAttributes' => ['list<ReflectionAttribute>', 'name='=>'?string', 'flags='=>'int'],
'ReflectionProperty::getDefaultValue' => ['mixed'],
'ReflectionProperty::hasDefaultValue' => ['bool'],
'ReflectionProperty::isPromoted' => ['bool'],
'ReflectionUnionType::getTypes' => ['list<ReflectionNamedType>'],
'SplFixedArray::getIterator' => ['Iterator'],
'WeakMap::count' => ['int'],
Expand Down Expand Up @@ -424,6 +427,10 @@
'old' => ['mixed', 'object='=>'object'],
'new' => ['mixed', 'object='=>'null|object'],
],
'ReflectionProperty::isInitialized' => [
'old' => ['bool', 'object'=>'object'],
'new' => ['bool', 'object='=>'null|object'],
],
'SplFileInfo::getFileInfo' => [
'old' => ['SplFileInfo', 'class='=>'class-string'],
'new' => ['SplFileInfo', 'class='=>'?class-string'],
Expand Down Expand Up @@ -553,8 +560,8 @@
'new' => ['array', 'array'=>'array', '...arrays='=>'array'],
],
'array_filter' => [
'old' => ['array', 'array'=>'array', 'callback='=>'callable(mixed,mixed=):scalar', 'mode='=>'int'],
'new' => ['array', 'array'=>'array', 'callback='=>'callable(mixed,mixed=):scalar|null', 'mode='=>'int'],
'old' => ['array', 'array'=>'array', 'callback='=>'callable(mixed,array-key=):mixed', 'mode='=>'int'],
'new' => ['array', 'array'=>'array', 'callback='=>'callable(mixed,array-key=):mixed|null', 'mode='=>'int'],
],
'array_key_exists' => [
'old' => ['bool', 'key'=>'string|int', 'array'=>'array|object'],
Expand Down
1 change: 1 addition & 0 deletions dictionaries/CallMap_81_delta.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'ReflectionFunctionAbstract::hasTentativeReturnType' => ['bool'],
'ReflectionFunctionAbstract::isStatic' => ['bool'],
'ReflectionObject::isEnum' => ['bool'],
'ReflectionProperty::isReadonly' => ['bool'],
'sodium_crypto_stream_xchacha20' => ['non-empty-string', 'length'=>'positive-int', 'nonce'=>'non-empty-string', 'key'=>'non-empty-string'],
'sodium_crypto_stream_xchacha20_keygen' => ['non-empty-string'],
'sodium_crypto_stream_xchacha20_xor' => ['string', 'message'=>'string', 'nonce'=>'non-empty-string', 'key'=>'non-empty-string'],
Expand Down
Loading

0 comments on commit 3238f4e

Please sign in to comment.