Closed lolli42 closed 2 months ago
getAttribute($className) now always returns an instance of $className, or throws. This avoids checking the returned instance and helps with type hinting in IDEs.
I can confirm that code completion works in my VSCode setup:
Due to a bug in PhpStorm, we can't test this, but we can expect it to work there, too.
phpstorm issue: https://youtrack.jetbrains.com/issue/WI-75368/class-stringT-does-not-infer-the-right-type
getAttribute($className) now always returns an instance of $className, or throws. This avoids checking the returned instance and helps with type hinting in IDEs.