New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression between 1.10.10 and 1.10.51 #10377
Comments
Commit llaville/sarif-php-sdk@a9a56bb fixed issue still pending and now my codebase is now PHPStan 1.10.51 rule 9 compatible ! |
Your code snippet shows only a trait. Traits are analysed in context of each class that uses them. If I use the trait, the error is reported: https://phpstan.org/r/2d2e00e1-f6f0-4f3d-b4cf-925ecad4c440 Learn more: https://phpstan.org/blog/how-phpstan-analyses-traits |
If I analyse all source code as shown by screenshot, with same config file and code, v1.10.10 detect issue, while 1.10.51 do not. |
In that case the reproduction is not faithful enough. If you struggle to reproduce the problem in the playground, you can also create a small reproducing repository that shows the problem. You can also pin-point down the specific PHPStan version that broke this. |
I'll reopen if you provide a reproduction. |
Hello @ondrejmirtes Here is a workflow to reproduce issue. I've tested it and run it on my private repo, but I found at least when behavior became to change. Hope you'll reconsider this as a regression ? NOTE:
And now the GitHub Workflow I've used to test regression ! ---
# https://github.com/phpstan/phpstan/issues/10377
name: PHPStan issue 10377
on:
workflow_dispatch:
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
inputs:
phpstan-version:
description: "PHPStan latest version"
required: false
type: string
default: "1.10.51"
jobs:
phpstan:
name: PHPStan
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-22.04"
php-version:
- "8.2"
phpstan-version:
- "1.10.10"
- ${{ github.event.inputs.phpstan-version }}
steps:
- # https://github.com/actions/checkout
name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 1
repository: llaville/sarif-php-sdk
ref: 8162500edf9254f8e83635b4b933dcade90d7c7e
- # https://github.com/shivammathur/setup-php
name: Setup PHP runtime
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: "none"
- name: "Download phpstan.phar"
run: |
curl -Ls https://github.com/phpstan/phpstan/releases/download/${{ matrix.phpstan-version }}/phpstan.phar -o /usr/local/bin/phpstan
chmod +x /usr/local/bin/phpstan
- # https://github.com/ramsey/composer-install
name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: "highest"
composer-options: "--prefer-dist --no-scripts"
- # Analyse source code with PHAR artifact of PHPStan 1.10.x
name: Analyze source code
shell: bash
run: |
/usr/local/bin/phpstan analyse --no-ansi -c "${GITHUB_WORKSPACE}/.github/linters/phpstan.neon.dist" --debug -vvv
|
Probably because of what has applied on https://github.com/phpstan/phpstan/releases/tag/1.10.23, seen on release notes (chunk below) : Fix processing traits with renamed methods (phpstan/phpstan-src@c6035f3), #7198, #6039, #4758 |
Alright so on 1.10.22 the error is:
On 1.10.23 the error disappears. Class WebRequest uses trait RequestParameters with The error is reported inside |
Here's a straightforward reproduction: https://phpstan.org/r/00447904-0c4f-433e-9f94-740916dd4aba Line 32 should be analysed too. |
Fixed: phpstan/phpstan-src@2270051 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
I'm currently working to polish code on branch
1.1
of my project https://github.com/llaville/sarif-php-sdk with help of PHPStanAnd I've noticed a possible regression between version 1.10.10 and 1.10.51 !
All seems good with 1.10.51
But I got at least one issue not detected with 1.10.51, but 1.10.10 found it
My config file is :
Code snippet that reproduces the problem
https://phpstan.org/r/e1376c55-7033-4477-a8f4-31f960cd4797
Expected output
[ERROR] Found 1 error
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: