sharp icon indicating copy to clipboard operation
sharp copied to clipboard

CurrentSharpRequest bug

Open dv5150 opened this issue 2 years ago • 0 comments

I'm not sure if I mess up things or I've encountered a bug, at least it looks like no one else mentioned it before.

The exception I'm getting after setting up a fresh Laravel 9.19 project with Sharp 7.11 on PHP 8.1:

Code16\Sharp\Http\Context\CurrentSharpRequest::getEntityMenuLabel(): Argument #1 ($entityKey) must be of type string, null given, called in C:\laragon\www\tabby\vendor\code16\sharp\src\Http\Context\CurrentSharpRequest.php on line 92

A possible solution would be to change

CurrentSharpRequest@getEntityMenuLabel(string $entityKey): ?string to CurrentSharpRequest@getEntityMenuLabel(?string $entityKey): ?string

because method $this->entityKey() - which is given as the parameter by default - allows to return with null

dv5150 avatar Jul 28 '22 20:07 dv5150