Skip to content
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

Lock phpdocumentor/reflection-docblock version #165

Merged

Conversation

IanDelMar
Copy link
Contributor

The release of phpDocumentor/ReflectionDocBlock v5.4.0 seems to have introduced an issue affecting the visitor functionality. Numerous @phpstan-param and @phpstan-return annotations are no longer present. Further investigation is needed. Locking the version at 5.3.0 is as a temporary measure until the issue is resolved.

@szepeviktor
Copy link
Member

szepeviktor commented Apr 13, 2024

Thank you!

Reverting to phpdocumentor/reflection-docblock 5.3.0 caused no change in the stubs file.
Core version 6.3.3

What change should I expect?

@IanDelMar
Copy link
Contributor Author

See here: https://github.com/IanDelMar/wordpress-stubs/tree/phpdoc-demo

These steps

  1. Lock phpdocumentor/reflection-docblock to 5.3
  2. Generate stubs for v6.3.3 with phpdocumentor/reflection-docblock locked
  3. Unlock phpdocumentor/reflection-docblock
  4. Generate stubs for v6.3.3 with phpdocumentor/reflection-docblock unlocked

give this diff:
IanDelMar@00b5088#diff-4dc94858ed12d457b90cbe75a4151de2b69d60a4693fc574a0bf8d4b71923f31

@szepeviktor
Copy link
Member

Thank you. I run it on PHP 7.4
Are you on 8+?

@szepeviktor
Copy link
Member

I've tried running it on PHP 8.1. Now I see the difference.
The problem is I will run everything on PHP 7.4 -> the big green: https://wordpress.org/about/stats/#php_versions

@IanDelMar
Copy link
Contributor Author

This happens with PHP 7.4 as well.

I first thought that my local setup caused it and then tried with this workflow which gave the same result:

name: Generate stubs

on: workflow_dispatch

env:
  php-version: '7.4'

jobs:
  generate-stubs:
    name: Generate stubs
    runs-on: ubuntu-latest

    permissions:
      contents: write

    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Install PHP
      uses: shivammathur/setup-php@v2
      with:
        coverage: none
        ini-file: development
        php-version: ${{ env.php-version }}

    - name: Install dependencies
      run: composer install --no-interaction --no-progress --prefer-dist

    - name: Generate stubs
      run: |
        ./generate.sh # Generate stubs

    - name: Commit file
      run: |
        git config --local user.name "GitHub Actions"
        git config --local user.email "[email protected]"
        git add wordpress-stubs.php
        git commit -m "Update WordPress stubs" || exit 0
        git push origin ${{ github.ref_name }}

@szepeviktor
Copy link
Member

szepeviktor commented Apr 13, 2024

All right.

I want Core contributors to put all these types into core.

@szepeviktor szepeviktor merged commit ac2f7a0 into php-stubs:master Apr 13, 2024
2 checks passed
@IanDelMar
Copy link
Contributor Author

The "Integrate" workflow does not cache the dependencies. I think it should also be reproducible if you rerun the workflow on #162.

@IanDelMar
Copy link
Contributor Author

Related #166

@szepeviktor
Copy link
Member

szepeviktor commented Apr 13, 2024

I do not benefit from this project!!! No new client with WordPress from phpstan/php-stubs.

BTW I always manually review stubs changes.

@szepeviktor
Copy link
Member

it should also be reproducible

I know how to make this project robust. But this project runs against WordPress development. Core should contains these by default.

@IanDelMar
Copy link
Contributor Author

BTW I always manually review stubs changes.

Presently, I am doing this for v6.5. I will initiate a pull request once I have completed reviewing the changes.

@IanDelMar IanDelMar deleted the phpdocumentor/reflection-docblock branch April 14, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants