zendframework / zend-validator

Validator component from Zend Framework
BSD 3-Clause "New" or "Revised" License
181 stars 136 forks source link

Missing requirement in composer.json #222

Closed rkeet closed 6 years ago

rkeet commented 6 years ago

https://github.com/zendframework/zend-validator/blob/87e743d11d49a157011a49a962c25e7a11adc7c5/src/Csrf.php#L13

Module requires module Zend Math. Module listed in composer.json as required under require-dev, not in require section (see here).

Can cause a Class 'Zend\Math\Rand' not found error.

Busy/late atm so do not have time to go fork/update/pr/whatever stuff; thought to report.

froschdesign commented 6 years ago

Is already included in the suggest section:

https://github.com/zendframework/zend-validator/blob/87e743d11d49a157011a49a962c25e7a11adc7c5/composer.json#L34-L38

Duplicate of #147 and #83

rkeet commented 6 years ago

As #83 was opened in 2016 and #147 halfway 2017 and the fact this has not been fixed, I would argue it would be better to make these requirements for now, until a separation into separate modules is done.

Now you must go on a hunt to see what's going wrong because Zend\Math is not required/autoloaded.

froschdesign commented 6 years ago

I would argue it would be better to make these requirements for now…

And then comes the next reporter, we should set the zend-math component as optional. 😉

…until a separation into separate modules is done.

  1. There are already 163 components which need to be maintained.
  2. zend-validator will be revised.

The suggest section in a Composer file is for all packages they are not strictly required. zend-math is only used in the CSRF validator and therefore not strictly required.