In 5bfc0f960b, risky casting was invoked
as a way to show there is an issue here. However, it is not always
possible to use a string. For instance, there is no such thing as this
in PHP: ["1" => "whatever"]. If you try to create such an array, you
will obtain [1 => "whatever"] instead.
Ironically, this was copied in jetbrains/phpstorm, which is used in
PHPStan, which exhibited that false positive.
See https://github.com/JetBrains/phpstorm-stubs/pull/1454
The SOAP extension stub was missing some constants we used (really just
SOAP_1_1 and SOAP_1_2), so I thought I'd add the rest of the constants
declared by the extension to the stub. Values are all pulled straight
from the PHP docs.
This stubs out the class constants for ZipArchive, which I believe are
the only constants introduced by the `zip` extension. This should allow
Psalm to run over code utilizing any of these constants even if the
analyzing system doesn't have ext-zip installed/enabled (e.g. a GitHub
Actions container).
- make SimpleXmlElement and SimpleXmlIterator not a universal object crate
- added typed magic __get method to SimpleXmlElement
- adjusted tests to reflect new behaviour of SimpleXmlElement
- added tests
Both of these define "fuzzy" datatypes, which are mostly evaluated at runtime.
Currently, much of regular use of these will cause useless errors, so define
the stubs so that they simply support any kind of use that could happen.