Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
php-version: "8.4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd do this a bit differently:

  1. Install ${{ matrix.php-version }}
  2. Run the composer steps
  3. Only when downgrading: install 8.4
  4. Transform source code
  5. Only when downgrading: install ${{ matrix.php-version }} again

You can try playing with https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action to see if we can achieve DRY across different workflows.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I want to avoid is always start by installing 8.4 which is immediately going to be ovewritten with matrix version.

Copy link
Contributor Author

@staabm staabm Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd do this a bit differently:

done

You can try playing with docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action to see if we can achieve DRY across different workflows.

I would do that in a followup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what todo with the "Compile PHAR" - or what the actual problem is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link the failure? I don't see anything big.

If you mean "Checksum PHAR" - that's fine. The idea behind that job is that the PHAR checksum should not change when src/ doesn't change.

If we change something about the compilation process then it's fine if PHAR contents change. I suspect that some ConstFetches now use FQN like \null so the source slightly changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean "Checksum PHAR" - that's fine.

yep, that one. wasn't sure what it means


- name: "Downgrade PHPUnit"
if: matrix.php-version == '7.4' || matrix.php-version == '8.0' || matrix.php-version == '8.1'
Expand All @@ -54,6 +54,12 @@ jobs:
./compiler/vendor/bin/simple-downgrade downgrade -c build/downgrade.php ${{ matrix.php-version }}
composer dump
- name: "Change to runtime PHP version"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Validate Composer"
run: "composer validate"

Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
php-version: "8.4"
ini-file: development
extensions: mbstring

Expand All @@ -65,6 +65,14 @@ jobs:
./compiler/vendor/bin/simple-downgrade downgrade -c build/downgrade.php ${{ matrix.php-version }}
composer dump

- name: "Change to runtime PHP version"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-file: development
extensions: mbstring

- name: "PHPStan"
run: "make phpstan"

Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
php-version: "8.4"
tools: pecl
extensions: ds,mbstring
ini-file: development
Expand All @@ -194,5 +194,15 @@ jobs:
./compiler/vendor/bin/simple-downgrade downgrade -c build/downgrade.php ${{ matrix.php-version }}
composer dump
- name: "Change to runtime PHP version"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: pecl
extensions: ds,mbstring
ini-file: development
ini-values: memory_limit=2G

- name: "Tests"
run: "make tests"
6 changes: 3 additions & 3 deletions compiler/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"description": "PHAR Compiler for PHPStan",
"license": ["MIT"],
"require": {
"php": "^8.0",
"php": "^8.2",
"nette/neon": "^3.0.0",
"ondrejmirtes/simple-downgrader": "^2.2.1",
"ondrejmirtes/simple-downgrader": "^2.2.2",
"seld/phar-utils": "^1.2",
"symfony/console": "^5.4.43",
"symfony/filesystem": "^5.4.43",
Expand All @@ -30,7 +30,7 @@
},
"config": {
"platform": {
"php": "8.0.99"
"php": "8.2.99"
},
"platform-check": false,
"sort-packages": true
Expand Down
140 changes: 10 additions & 130 deletions compiler/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,14 @@ public function testBug10312b(): void
$this->analyse([__DIR__ . '/data/bug-10312b.php'], []);
}

#[RequiresPhp('>= 8.1')]
public function testBug10312c(): void
{
$this->checkProtectedAndPublicMethods = true;
$this->analyse([__DIR__ . '/data/bug-10312c.php'], []);
}

#[RequiresPhp('>= 8.1')]
public function testBug10312d(): void
{
$this->checkProtectedAndPublicMethods = true;
Expand Down
Loading