I have been trying to get through the "getting started" tutorial for Zend Framework 3. It has been going well, but once I get to "Forms and Actions" things stop working.
The tutorial is here: https://docs.zendframework.com/tutorials/getting-started/forms-and-actions/
This is the error I keep getting:
Fatal error: Declaration of Zend\Form\Form::bindValues(array $values = Array) must be compatible with Zend\Form\Fieldset::bindValues(array $values = Array, ?array $validationGroup = NULL) in ...\zendtest\vendor\zendframework\zend-form\src\Form.php on line 24
I get this after I have created AlbumForm.php, implemented InputFilterAwareInterface in Album.php, created the add.phtml view script and copied the needed logic in AlbumController.php. Everything has been copied from the tutorial.
I was not able to find anyone through Google that has had the same problem, so I must be doing something very wrong, but I can't see what it is.
Does anyone have an idea to what I could be doing wrong?
The error is caused by the mismatch of the definitions of the method "bindValues" between the child class "Zend\Form\Form" and its parent "Zend\Form\Fieldset".
The definition of "Zend\Form\Fieldset" was changed since release 2.9.1(github link), but for "Zend\Form\Form" since release 2.11.0(github link).
You probably have installed a release between those version >=2.9.1 and < 2.11.0. Run a composer update in your skeleton root to get the latest release(currently is 2.11.0) of Zend form package:
composer update
or
php /path/to/composer.phar update