有没有办法限制供应商的软件包版本要求

I'm using the acelaya/zf2-acqrcode package (v0.2.0) It requires "endroid/qrcode": ">=1.2.0", (meaning everything higher than or equal to 1.2.0)

Currently the latest version of the "endroid/qrcode" package = v3.2.12

The acelaya/zf2-acqrcode package (v0.2.0) uses a function that doesn't exist anymore in endroid/qrcode versions > 1.9.3

Is there any way I can tell composer not to install a version of the endroid/qrcode package higher than 1.9.3?

Yes you can restrict the package versions by using the ~ operator in composer.json. More Information on that can be found Here

Hope this helps.

Use the following to lock the endroid/qrcode dependency to 1.9.3. Sub dependencies will adhere to this and honour the fact you've locked acelaya/zf2-acqrcode.

Note: this will only fail when another dependency requires >1.9.3 of endroid/qrcode

{
    "require": {
        "endroid/qrcode": "1.9.3",
        "acelaya/zf2-acqrcode": "^1.0"
    }
}

Run the command following command:

/path/to/composer.phar require endroid/qrcode:1.9.3

Here's the output of the above required dependencies:

$ composer install                                                     
Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 18 installs, 0 updates, 0 removals
  - Installing zendframework/zend-stdlib (3.2.0): Loading from cache
  - Installing zendframework/zend-loader (2.6.0): Loading from cache
  - Installing zendframework/zend-eventmanager (3.2.1): Loading from cache
  - Installing zendframework/zend-view (2.10.0): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Installing container-interop/container-interop (1.2.0): Loading from cache
  - Installing zendframework/zend-servicemanager (3.3.2): Loading from cache
  - Installing zendframework/zend-validator (2.10.2): Loading from cache
  - Installing zendframework/zend-escaper (2.6.0): Loading from cache
  - Installing zendframework/zend-uri (2.6.1): Loading from cache
  - Installing zendframework/zend-http (2.8.0): Loading from cache
  - Installing zendframework/zend-router (3.0.2): Loading from cache
  - Installing zendframework/zend-config (3.2.0): Loading from cache
  - Installing zendframework/zend-modulemanager (2.8.2): Loading from cache
  - Installing zendframework/zend-mvc (3.1.1): Loading from cache
  - Installing symfony/options-resolver (v3.4.11): Loading from cache
  - Installing endroid/qrcode (1.9.3): Loading from cache
  - Installing acelaya/zf2-acqrcode (v1.0.0): Loading from cache