Closed gsteel closed 11 months ago
Thanks @Slamdunk - I've adjusted the tests to use setValueOptions
where appropriate and also properly deprecated providing "value options" in the options
key to setAttributes
- Also added deprecated tests to cover the deprecation.
Sorry, the patch is a bit bigger now, but the change to scalar|null of course caused a lot of valid psalm issues that needed fixing
What a refreshing patch, thank you @gsteel
Thanks to you too @Slamdunk and @Ocramius for the reviews :)
@Slamdunk Do you have any rules on what changes can go into a minor version and what cannot? Signature change in minor version is not something I'd expect.
@pavattt
Signature change in minor version is not something I'd expect.
Only allowed in major versions. Do you find a problem?
@froschdesign I've upgraded laminas/laminas-form from 3.13.1 to 3.17, and now I have a ton of issues in static analysis I have to fix.
@Slamdunk Do you have any rules on what changes can go into a minor version and what cannot? Signature change in minor version is not something I'd expect.
It's a bit of a gray area here, because SA shifts regularly (even with patch versions of psalm and phpstan).
We keep BC on anything that would otherwise require changes in the code for:
For changes such as more precise data structures and types, it is very improbable that you'll get BC on that, as the types can easily shift with tiny changes, even in other packages that declare better types.
My general suggestion when doing a composer.lock
change that introduces new type errors is to have a baseline file (supported by both PHPStan and Psalm), updating that, and deciding which errors that were introduced are worth fixing immediately.
Description
Marks all attribute arrays and iterables as
<string, mixed>
which is slightly better than<array-key, mixed>
This is pretty minor stuff, but it really helps in consumer projects running psalm.
I considered that we could have gone for
<string, scalar|null>
but I'm fairly sure there are cases where arrays are accepted, or maybe even iterables at which point,<string, mixed>
felt like a better middle ground consideringElementInterface::getAttribute(string $name): mixed