Deze pagina is nog niet beschikbaar in uw eigen taal. We werken er hard aan om meer taalversies toe te voegen. Bedankt voor uw steun.

On this page

Show all

Help Center/ Object Storage Service/ SDK Reference/ PHP/ FAQs/ How Do I Resolve "Declaration of xxxx must be compatible with xxxx problem"?

How Do I Resolve "Declaration of xxxx must be compatible with xxxx problem"?

Updated on 2024-01-08 GMT+08:00

Such an error happens typically when versions are incompatible, given that dependencies for open-source software in the community are updated irregularly. The following gives an example error:

Declaration of Obs\Internal\Common\CheckoutStream::read($length) must be compatible with Psr\Http\Message\StreamInterface::read(int $length)

This error says that CheckoutStream::read($length) does not declare the int type. A possible reason is that psr/http-message has a newer version, the number of which can be obtained from composer.lock. GitHub also shows that psr/http-message has been upgraded from version 1.1 to 2.0, with the int type declared in 2.0. To resolve this error, you can downgrade psr/http-message to version 1.1.

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback