the registerNavigation() method in Curator.php Facade is expected to receive a bool|Closure|null types, but the actual variable $shoudlRegisterNavigation is typed only as bool.
public function registerNavigation(bool|Closure|null $condition = true): static
{
$this->shouldRegisterNavigation = $condition;
return $this;
}
This ends up in an error when passing a closure to the registerNavigation() in the Curator facade, as I need to determine the registerNavigation using the authenticated user, that's why I needed to be evaluated in the closure.
Expected behavior
You should be able to pass a Closure to the registerNavigation() to determine whether register the navigation.
Steps to reproduce
In any service provider using the Curator facade, use the method registerNavigation() passing a Closure as a parameter.
This is caused by the property $shouldRegisterNavigation being declared only as bool type.
protected bool $shouldRegisterNavigation = true;
If you change the vendor and type it as bool|Closure it works fine as the shouldRegisterNavigation() method evaluates the variable using evaluate() function.
Filament Version
v2.17.55
Plugin Version
v2.10.2
PHP Version
PHP 8.2
Problem description
the
registerNavigation()
method in Curator.php Facade is expected to receive abool|Closure|null
types, but the actual variable$shoudlRegisterNavigation
is typed only asbool
.This ends up in an error when passing a closure to the
registerNavigation()
in the Curator facade, as I need to determine the registerNavigation using the authenticated user, that's why I needed to be evaluated in the closure.Expected behavior
You should be able to pass a Closure to the
registerNavigation()
to determine whether register the navigation.Steps to reproduce
In any service provider using the Curator facade, use the method
registerNavigation()
passing a Closure as a parameter.You will see the following error.
This is caused by the property $shouldRegisterNavigation being declared only as bool type.
If you change the vendor and type it as bool|Closure it works fine as the
shouldRegisterNavigation()
method evaluates the variable usingevaluate()
function.Reproduction repository
No response
Relevant log output
No response