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

duplicate stubs error #466

Open
staabm opened this issue Nov 16, 2022 · 6 comments
Open

duplicate stubs error #466

staabm opened this issue Nov 16, 2022 · 6 comments

Comments

@staabm
Copy link
Owner

staabm commented Nov 16, 2022

need to figure out a way how we can handle these stub errors and test whether we still need these stub files after all

phpstan/phpstan#8378

I cannot reproduce it yet or know the exact circumstances, but I sometimes get errors like

 ------ -----------------------------------------------------------------
  Line   vendor-bin\phpstan\vendor\staabm\phpstan-dba\config\Mysqli.stub
 ------ -----------------------------------------------------------------
  3      Class mysqli_stmt declared multiple times:

 ------ -----------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------
  Line   vendor-bin\phpstan\vendor\staabm\phpstan-dba\config\PdoStatement.stub
 ------ ---------------------------------------------------------------------------------------------------------------
  11     Class PDOStatement declared multiple times:
         -
         phar://C:/dvl/Workspace/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan.phar/stubs/PDOStatement.stub
         :8
 ------ ---------------------------------------------------------------------------------------------------------------

 ------ ----------------------------------------------------------------------------------------------------
  Line   vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan.phar/stubs/PDOStatement.stub
 ------ ----------------------------------------------------------------------------------------------------
  8      Class PDOStatement declared multiple times:
         - C:/dvl/Workspace/daiber/vendor-bin/phpstan/vendor/staabm/phpstan-dba/config/PdoStatement.stub:11
 ------ ----------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------
  Line   vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan.phar/stubs/mysqli.stub
 ------ --------------------------------------------------------------------------
  3      Class mysqli_stmt declared multiple times:

 ------ --------------------------------------------------------------------------

@staabm
Copy link
Owner Author

staabm commented Dec 12, 2022

see phpstan/phpstan-src#2096

@pscheit
Copy link

pscheit commented Dec 16, 2022

@staabm since the PdoStatement.stub is now in phpstan-src merged + released, it needs to be removed here, too, right?

@staabm
Copy link
Owner Author

staabm commented Dec 16, 2022

It doesn't work yet with stubs from phpstan-src only.

I don't know yet how we can make this error go away.

If you got this error, you can proceed like usual. It is reported only when no result cache exists. As soon as the result cache is generated the error no longer happens

@pscheit
Copy link

pscheit commented Dec 16, 2022

since we have loaded bleedingEdge.neon I (for now) disabled the feature that detects doubles:

parameters:
    featureToggles:
        duplicateStubs: false  # workaround for: https://github.com/staabm/phpstan-dba/issues/466

in the CI it will fail all the time, cause the result cache isnt existing

@pscheit
Copy link

pscheit commented Dec 16, 2022

Ondrej sounds like, that there will be no fix. Duplicate stubs are not allowed, when they are in phpstan-src :/

@staabm
Copy link
Owner Author

staabm commented Dec 16, 2022

in the CI it will fail all the time, cause the result cache isnt existing

You should enable the result cache in CI. It saves a lot of time. e.g. with GithubActions you can use actions/cache to persist the cache between build jobs

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

No branches or pull requests

2 participants