Package Version
2.22.0
Php Version
8.3
Database Engine
None
Basic Information
Commit 631f035 changed the return type of Adapter::getDriver to DriverInterface|array. This is wrong because while this is the correct type for the constructor parameter, the property and therefore also the getter is just DriverInterface.
This change became part of the 2.22.0 pre-release which I required in my project which uses PHPStan. This then reported the following error:
Cannot call method getConnection() on array|Laminas\Db\Adapter\Driver\DriverInterface
Steps to Reproduce
- Set up a project with this package as a dependency
- Set up static type analysis like PHPStan or Psalm
- Add code that calls getConnection on Adapter::getDriver
Expected Behavior
No errors
Actual behavior?
Errors from static analysers
Additional Info
No response
Package Version
2.22.0
Php Version
8.3
Database Engine
None
Basic Information
Commit 631f035 changed the return type of Adapter::getDriver to DriverInterface|array. This is wrong because while this is the correct type for the constructor parameter, the property and therefore also the getter is just DriverInterface.
This change became part of the 2.22.0 pre-release which I required in my project which uses PHPStan. This then reported the following error:
Steps to Reproduce
Expected Behavior
No errors
Actual behavior?
Errors from static analysers
Additional Info
No response