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

Error while updating L5-Swagger v. 8.2.0 #444

Closed
stavtsob opened this issue Feb 3, 2022 · 1 comment
Closed

Error while updating L5-Swagger v. 8.2.0 #444

stavtsob opened this issue Feb 3, 2022 · 1 comment

Comments

@stavtsob
Copy link

stavtsob commented Feb 3, 2022

  • L5-Swagger Version: 8.2.0 (composer show | grep l5-swagger)
  • PHP Version (php -v): PHP 7.4.3
  • OS: Ubuntu 20.04 lts

Description:

After a composer update, I got the new version of l5-swagger, but a strange error appeared.
I have a custom package that uses swagger comment annotations, but while doing the 'composer update' all the content of the blade files, where echoed to the console.
After that, an error appeared:

Symfony\Component\ErrorHandler\Error\FatalError

Cannot redeclare Composer\Autoload\includeFile() (previously declared in /.............../vendor/composer/ClassLoader.php:478)

@DerManoMann
Copy link

Updating your dependencies should help. This is caused by a version of swagger-php that actively loads files to ensure the contained classes are available for reflection.

However, if your files are blade template files this might still not work as expected, as swagger-php v4 requires annotations to be associated with a class/interface/etc. in order to have a 'hook' for reflection.

Annotations that do not 'annotate' something will no longer work.

More details can be found here: https://zircote.github.io/swagger-php/guide/faq and here: https://zircote.github.io/swagger-php/guide/migrating-to-v4

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

3 participants