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.15.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.16.0
Choose a head ref
Loading
Showing 472 changed files with 6,483 additions and 1,566 deletions.
8 changes: 6 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -11,6 +11,9 @@ executors:
php-81:
docker:
- image: thecodingmachine/php:8.1-v4-cli
php-82:
docker:
- image: thecodingmachine/php:8.2-v4-cli
jobs:
"Code Style Analysis":
executor: php-74
@@ -50,7 +53,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:
@@ -66,7 +70,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:
2 changes: 1 addition & 1 deletion .github/workflows/bcc.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ jobs:
env:
fail-fast: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

4 changes: 2 additions & 2 deletions .github/workflows/build-phar.yml
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ jobs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5.3.0
uses: fkirc/skip-duplicate-actions@v5.3.1
with:
concurrent_skipping: always
cancel_others: true
@@ -44,7 +44,7 @@ jobs:
env:
fail-fast: true

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

6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ jobs:
env:
fail-fast: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get Composer Cache Directories
id: composer-cache
@@ -63,7 +63,7 @@ jobs:
env:
fail-fast: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get Composer Cache Directories
id: composer-cache
@@ -149,7 +149,7 @@ jobs:
env:
fail-fast: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get Composer Cache Directories
id: composer-cache
2 changes: 1 addition & 1 deletion .github/workflows/shepherd.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
2 changes: 1 addition & 1 deletion .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ jobs:
env:
fail-fast: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get Composer Cache Directories
id: composer-cache
1 change: 1 addition & 0 deletions bin/test-with-real-projects.sh
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ psl)
cd endtoend-test-psl
git checkout 2.3.x
composer install
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
;;
18 changes: 17 additions & 1 deletion bin/tests-github-actions.sh
Original file line number Diff line number Diff line change
@@ -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
}

15 changes: 10 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vimeo/psalm",
"type": "library",
"type": "project",
"description": "A static analysis tool for finding errors in PHP applications",
"keywords": [
"php",
@@ -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"
@@ -59,7 +59,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",
@@ -134,10 +134,15 @@
"scripts-descriptions": {
"cs": "Checks that the code conforms to the coding standard.",
"cs-fix": "Automatically correct coding standard violations.",
"lint": "Runs unit tests.",
"lint": "Lint php files.",
"phpunit": "Runs unit tests in parallel.",
"phpunit-std": "Runs unit tests.",
"psalm": "Runs static analysis.",
"tests": "Runs all available tests."
},
"support": {
"docs": "https://psalm.dev/docs",
"issues": "https://github.com/vimeo/psalm/issues",
"source": "https://github.com/vimeo/psalm"
}
}
Loading