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

Replacing laminas/laminas-zendframework-bridge without providing its functionality breaks packages #2028

Closed
mussbach opened this issue Feb 26, 2021 · 6 comments · Fixed by #2032

Comments

@mussbach
Copy link
Contributor

Describe the Bug

In f2516b0 (#1946) was introduced that this package replaces laminas/laminas-zendframework-bridge. I do not really understand why this package should be replaced by phpword, which is especially weird as newly required laminas/laminas-escaper itself requires laminas/laminas-zendframework-bridge

In my opinion #1946 breaks setups where other libraries need laminas/laminas-zendframework-bridge. I am a bit hesitating, as no one else seems to have this problem. Perhaps anybody could help me to understand, what happens here?

Steps to Reproduce

Install phpword 0.18 in a setup with a package requiring the bridge. Then call anything.

Expected Behavior

Nothing should break

Current Behavior

A fatal error occurs Attempted to load class "ClassGenerator" from namespace "Zend\Code\Generator". Did you forget a "use" statement for e.g. "Laminas\Code\Generator\ClassGenerator"

Context

Please fill in your environment information:

  • PHP Version: 7.3
  • PHPWord Version: 0.18
@liborm85
Copy link
Contributor

Package laminas/laminas-zendframework-bridge is replaced/removed because PHPWord uses new Laminas namespace and bridge for deprecated Zend namespace is not required.

@mussbach
Copy link
Contributor Author

Yes, of course, fair enough, but why does composer.json claims that phpword replaces the bridge via
"replace": { "laminas/laminas-zendframework-bridge": "*" },

@damienlaguerre
Copy link

damienlaguerre commented Mar 3, 2021

I agree with @mussbach, the replacement breaks compatibility with other packages that need it.
In my case, the problem appears with Drupal.

@mussbach
Copy link
Contributor Author

mussbach commented Mar 4, 2021

@troosan would you mind checking this and perhaps publish a version 0.18.1? Otherwise we could unfortunately not install version 0.18 at all

@damienlaguerre
Copy link

While waiting for the fix, you can use an alias as a workaround: https://getcomposer.org/doc/articles/aliases.md

@mussbach
Copy link
Contributor Author

mussbach commented Mar 4, 2021

Thank you @damienlaguerre, this is a good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants