Skip to content

CurrentSharpRequest bug #427

@dv5150

Description

@dv5150

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions