You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The namespace declaration in that class is namespace SilverStripe\Admin;
This seems to be happening because NodeVisitor::manageHint() converts the typehint to a string (array|string|false) from its array representation which had the types separated into individual type declarations.
Then NodeVisitor::resolvehint() expects them to still be in the form of an array, but since they're not it goes "array|string|false isn't a PHP type and isn't a FQCN so it must be a class name relative to the current namespace", resulting in SilverStripe\Admin\array|string|false.
Type hints sometimes incorrectly include the namespace of the class they're from when they shouldn't.
For example: https://api.silverstripe.org/6/SilverStripe/Admin/AdminController.html#method_getRequiredPermissions
The markup for the typehint here is
<abbr title="SilverStripe\Admin\array|string|false">array|string|false</abbr>
- you can see it has evaluatedarray
asSilverStripe\Admin\array
.The source code for this is
https://github.com/silverstripe/silverstripe-admin/blob/eafa62e9ff167f4d5444b20867641f415be9b9f8/code/AdminController.php#L69
public static function getRequiredPermissions(): array|string|false
The namespace declaration in that class is
namespace SilverStripe\Admin;
This seems to be happening because
NodeVisitor::manageHint()
converts the typehint to a string (array|string|false
) from its array representation which had the types separated into individual type declarations.Then
NodeVisitor::resolvehint()
expects them to still be in the form of an array, but since they're not it goes "array|string|false
isn't a PHP type and isn't a FQCN so it must be a class name relative to the current namespace", resulting inSilverStripe\Admin\array|string|false
.PR
The text was updated successfully, but these errors were encountered: